org.apache.myfaces.trinidadinternal.share.xml
Class TreeBuilder

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.xml.TreeBuilder

public class TreeBuilder
extends java.lang.Object

Class responsible for building a tree of objects from an XML stack. TreeBuilders are thread safe, and so can be used from multiple threads simultaneously.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/xml/TreeBuilder.java#0 $) $Date: 10-nov-2005.18:59:16 $
Author:
The Oracle ADF Faces Team

Constructor Summary
TreeBuilder()
          Creates a TreeBuilder with no ParserManager or root class.
TreeBuilder(ParserManager manager, java.lang.Class<?> rootClass)
          Creates a TreeBuilder using a given ParserManager.
 
Method Summary
 org.xml.sax.EntityResolver getEntityResolver()
           
 java.lang.Object parse(org.xml.sax.InputSource source, NodeParser rootParser)
           
 java.lang.Object parse(XMLProvider provider, org.xml.sax.InputSource source)
          Parses the document.
 java.lang.Object parse(XMLProvider provider, org.xml.sax.InputSource source, ParseContext context)
          Parses the document.
 java.lang.Object parse(XMLProvider provider, org.xml.sax.InputSource source, ParseContext context, NodeParser rootParser)
          Parses the document.
 void setEntityResolver(org.xml.sax.EntityResolver resolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeBuilder

public TreeBuilder()
Creates a TreeBuilder with no ParserManager or root class. Such a TreeBuilder can only be used with NodeParsers that never try to use ParseContext.getParser().


TreeBuilder

public TreeBuilder(ParserManager manager,
                   java.lang.Class<?> rootClass)
Creates a TreeBuilder using a given ParserManager.

Parameters:
manager - the ParserManager to use
rootClass - the desired type of object to return as the root
Method Detail

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()

parse

public java.lang.Object parse(XMLProvider provider,
                              org.xml.sax.InputSource source)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Parses the document.

Parameters:
provider - an implementation of the XMLProvider interface
source - a SAX input source
Returns:
an object that is an instance of the desired class
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

public java.lang.Object parse(XMLProvider provider,
                              org.xml.sax.InputSource source,
                              ParseContext context)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Parses the document.

Parameters:
provider - an implementation of the XMLProvider interface
source - a SAX input source
context - a parsing context
Returns:
an object that is an instance of the desired class
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

public java.lang.Object parse(org.xml.sax.InputSource source,
                              NodeParser rootParser)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

public java.lang.Object parse(XMLProvider provider,
                              org.xml.sax.InputSource source,
                              ParseContext context,
                              NodeParser rootParser)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Parses the document.

Parameters:
provider - an implementation of the XMLProvider interface
source - a SAX input source
context - a parsing context
rootParser - the root parser to start with; if null, a root parser will be derived based on the rootClass requested in the constructor.
Returns:
an object that is the result of parsing.
Throws:
java.io.IOException
org.xml.sax.SAXException


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.