FileDocCategorySizeDatePackage
VariableResolver.javaAPI DocGlassfish v2 API5772Fri May 04 22:24:38 BST 2007com.sun.enterprise.config.serverbeans.validation

VariableResolver

public class VariableResolver extends XMLFilterImpl
This class provides the mechanism to resolve variables present in some given {@link InputSource}.

Fields Summary
private final FrameHolderBuilder
frameHolderBuilder
private final VariableExpander
ve
Constructors Summary
VariableResolver()

    
    
      
        super.setParent(getXMLReader());
    
Methods Summary
private org.xml.sax.InputSourcecopyInputSource(org.xml.sax.InputSource is)

        final StringWriter out = new StringWriter();
        final ToXMLStream xml = new ToXMLStream();
        xml.setWriter(out);
        final XMLReader r = getXMLReader();
        r.setContentHandler(xml);
        if (super.getEntityResolver() != null){
            r.setEntityResolver(super.getEntityResolver());
        }
        r.parse(is);
        final InputSource result= new InputSource(new StringReader(out.toString()){ public void close(){} });
        result.setPublicId(is.getPublicId());
        result.setSystemId(is.getSystemId());
        return result;
    
private org.xml.sax.XMLReadergetXMLReader()

        try{
        final XMLReader xr =  SAXParserFactory.newInstance().newSAXParser().getXMLReader();
        xr.setFeature("http://xml.org/sax/features/namespaces", true);
        xr.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
        return xr;
        }
        catch (ParserConfigurationException e){
            throw new SAXException(e);
        }
    
public voidparse(org.xml.sax.InputSource is)

        final InputSource is2 = copyInputSource(is);
        super.setContentHandler(frameHolderBuilder);
        super.parse(is2);
        is2.getCharacterStream().reset();
        ve.setFramer(new Framer(frameHolderBuilder.getFrameHolder()));
        ve.setParent(getParent());
        ve.parse(is2);
    
public voidsetContentHandler(org.xml.sax.ContentHandler contentHandler)

        ve.setContentHandler(contentHandler);