FileDocCategorySizeDatePackage
Util.javaAPI DocJava SE 6 API2778Tue Jun 10 00:22:48 BST 2008com.sun.org.apache.xerces.internal.jaxp.validation

Util

public final class Util extends Object

Static utility methods for the Validation API implementation.

author
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
version
$Id: Util.java,v 1.2.6.1 2005/09/01 14:16:37 sunithareddy Exp $

Fields Summary
Constructors Summary
Methods Summary
public static org.xml.sax.SAXExceptiontoSAXException(com.sun.org.apache.xerces.internal.xni.XNIException e)
Reconstructs {@link SAXException} from XNIException.

        if(e instanceof XMLParseException)
            return toSAXParseException((XMLParseException)e);
        if( e.getException() instanceof SAXException )
            return (SAXException)e.getException();
        return new SAXException(e.getMessage(),e.getException());
    
public static org.xml.sax.SAXParseExceptiontoSAXParseException(com.sun.org.apache.xerces.internal.xni.parser.XMLParseException e)

        if( e.getException() instanceof SAXParseException )
            return (SAXParseException)e.getException();
        return new SAXParseException( e.getMessage(),
        e.getPublicId(), e.getExpandedSystemId(),
        e.getLineNumber(), e.getColumnNumber(),
        e.getException() );
    
public static final com.sun.org.apache.xerces.internal.xni.parser.XMLInputSourcetoXMLInputSource(javax.xml.transform.stream.StreamSource in)
Creates a proper {@link XMLInputSource} from a {@link StreamSource}.

return
always return non-null valid object.

        if( in.getReader()!=null )
            return new XMLInputSource(
            in.getPublicId(), in.getSystemId(), in.getSystemId(),
            in.getReader(), null );
        if( in.getInputStream()!=null )
            return new XMLInputSource(
            in.getPublicId(), in.getSystemId(), in.getSystemId(),
            in.getInputStream(), null );
        
        return new XMLInputSource(
        in.getPublicId(), in.getSystemId(), in.getSystemId() );