FileDocCategorySizeDatePackage
Util.javaAPI DocJava SE 5 API4751Fri Aug 26 14:55:54 BST 2005com.sun.org.apache.xerces.internal.jaxp.validation

Util

public class Util extends Object
author
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

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() );