Home » freemarker-2.3.13 » freemarker.ext.dom » [javadoc | source]
freemarker.ext.dom
abstract public class: NodeModel [javadoc | source]
java.lang.Object
   freemarker.ext.dom.NodeModel

All Implemented Interfaces:
    AdapterTemplateModel, TemplateSequenceModel, WrapperTemplateModel, TemplateHashModel, TemplateNodeModel

Direct Known Subclasses:
    DocumentModel, AttributeNodeModel, CharacterDataNodeModel, PINodeModel, DocumentTypeModel, ElementModel

A base class for wrapping a W3C DOM Node as a FreeMarker template model.
Field Summary
static final  Logger logger     
static  Class xpathSupportClass     
final  Node node    The W3C DOM Node being wrapped. 
Constructor:
 protected NodeModel(Node node) 
Method from freemarker.ext.dom.NodeModel Summary:
equals,   exec,   get,   get,   getAdaptedObject,   getChildNodes,   getDocumentBuilderFactory,   getDocumentNodeModel,   getNode,   getNodeNamespace,   getNodeType,   getParentNode,   getQualifiedName,   getWrappedObject,   getXPathSupport,   getXPathSupportClass,   hashCode,   mergeAdjacentText,   parse,   parse,   parse,   parse,   removeComments,   removePIs,   setDocumentBuilderFactory,   setErrorHandler,   setXPathSupportClass,   simplify,   size,   useDefaultXPathSupport,   useJaxenXPathSupport,   useSunInternalXPathSupport,   useXalanXPathSupport,   wrap
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.ext.dom.NodeModel Detail:
 public boolean equals(Object other) 
 public TemplateModel exec(List args) throws TemplateModelException 
 public TemplateModel get(String key) throws TemplateModelException 
 public final TemplateModel get(int i) 
 public Object getAdaptedObject(Class hint) 
 public TemplateSequenceModel getChildNodes() 
 public static DocumentBuilderFactory getDocumentBuilderFactory() 
 NodeModel getDocumentNodeModel() 
 public Node getNode() 
 public String getNodeNamespace() 
 public final String getNodeType() throws TemplateModelException 
 public TemplateNodeModel getParentNode() 
 String getQualifiedName() throws TemplateModelException 
 public Object getWrappedObject() 
 XPathSupport getXPathSupport() 
 public static Class getXPathSupportClass() 
    Get the currently used freemarker.ext.dom.XPathSupport used as the XPath engine. Returns null if XPath support is disabled.
 public final int hashCode() 
 public static  void mergeAdjacentText(Node node) 
    Merges adjacent text/cdata nodes, so that there are no adjacent text/cdata nodes. Operates recursively on the entire subtree. You thus lose information about any CDATA sections occurring in the doc.
 public static NodeModel parse(InputSource is) throws IOException, SAXException, ParserConfigurationException 
    Create a NodeModel from an XML input source. By default, all comments and processing instruction nodes are stripped from the tree.
 public static NodeModel parse(File f) throws IOException, SAXException, ParserConfigurationException 
    Create a NodeModel from an XML file. By default, all comments and processing instruction nodes are stripped from the tree.
 public static NodeModel parse(InputSource is,
    boolean removeComments,
    boolean removePIs) throws IOException, SAXException, ParserConfigurationException 
    Create a NodeModel from a SAX input source. Adjacent text nodes will be merged (and CDATA sections are considered as text nodes).
 public static NodeModel parse(File f,
    boolean removeComments,
    boolean removePIs) throws IOException, SAXException, ParserConfigurationException 
    Create a NodeModel from an XML file.
 public static  void removeComments(Node node) 
    Recursively removes all comment nodes from the subtree.
 public static  void removePIs(Node node) 
    Recursively removes all processing instruction nodes from the subtree.
 public static  void setDocumentBuilderFactory(DocumentBuilderFactory docBuilderFactory) 
    Sets the DOM Parser implementation to be used when building NodeModel objects from XML files.
 public static  void setErrorHandler(ErrorHandler errorHandler) 
    sets the error handler to use when parsing the document.
 public static  void setXPathSupportClass(Class cl) 
    Set an alternative implementation of freemarker.ext.dom.XPathSupport to use as the XPath engine.
 public static  void simplify(Node node) 
    Removes comments and processing instruction, and then unites adjacent text nodes. Note that CDATA sections count as text nodes.
 public final int size() 
 public static  void useDefaultXPathSupport() 
    Tells the system to use (restore) the default (initial) XPath system used by this FreeMarker version on this system.
 public static  void useJaxenXPathSupport() throws Exception 
    Convenience method. Tells the system to use Jaxen for XPath queries.
 public static  void useSunInternalXPathSupport() throws Exception 
 public static  void useXalanXPathSupport() throws Exception 
    Convenience method. Tells the system to use Xalan for XPath queries.
 public static NodeModel wrap(Node node)