FileDocCategorySizeDatePackage
Util.javaAPI DocApache Xerces 3.0.12961Fri Sep 14 20:33:52 BST 2007org.apache.xerces.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 447235 2006-09-18 05:01:44Z mrglavas $

Fields Summary
Constructors Summary
Methods Summary
public static org.xml.sax.SAXExceptiontoSAXException(org.apache.xerces.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(org.apache.xerces.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 org.apache.xerces.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() );