org.sourceprojects.xmlparser
Interface TagDefinitionParser<B>

Type Parameters:
B - Type of ContextObject to use
All Known Implementing Classes:
AbstractTagParser

public interface TagDefinitionParser<B>

Interface for TagDefinitionParsers to implement. Defines basic methods to handle parsing and transforming of XML elements.

Since:
0.0.1
Author:
noctarius

Method Summary
 java.lang.String getNamespace()
          Returns the namespace URI this TagDefinitionParser implementation handles
 java.lang.String[] getTags()
          Returns a string array with all tags handled by this TagDefinitionParser implementation
 void parseElement(org.w3c.dom.Element element, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Parses an element.
 void parseElement(org.w3c.dom.Element element, java.lang.String localName, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Parses an element.
 void parseElement(org.w3c.dom.Element element, java.lang.String localName, javax.xml.namespace.QName parent, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Parses an element.
 org.w3c.dom.Node transformElement(org.w3c.dom.Element element, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Transforms an element.
 org.w3c.dom.Node transformElement(org.w3c.dom.Element element, java.lang.String localName, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Transforms an element.
 org.w3c.dom.Node transformElement(org.w3c.dom.Element element, java.lang.String localName, javax.xml.namespace.QName parent, ParserContext<B> parserContext, DefinitionBuilder definitionBuilder)
          Transforms an element.
 

Method Detail

getNamespace

java.lang.String getNamespace()
Returns the namespace URI this TagDefinitionParser implementation handles

Returns:
NamespaceURI

getTags

java.lang.String[] getTags()
Returns a string array with all tags handled by this TagDefinitionParser implementation

Returns:
handled tags

parseElement

void parseElement(org.w3c.dom.Element element,
                  ParserContext<B> parserContext,
                  DefinitionBuilder definitionBuilder)
                  throws XmlParserParsingException
Parses an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException

parseElement

void parseElement(org.w3c.dom.Element element,
                  java.lang.String localName,
                  ParserContext<B> parserContext,
                  DefinitionBuilder definitionBuilder)
                  throws XmlParserParsingException
Parses an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
localName - Name, as String, of the actual element
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException

parseElement

void parseElement(org.w3c.dom.Element element,
                  java.lang.String localName,
                  javax.xml.namespace.QName parent,
                  ParserContext<B> parserContext,
                  DefinitionBuilder definitionBuilder)
                  throws XmlParserParsingException
Parses an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
localName - Name, as String, of the actual element
parent - QName instance of the parent element, null if no parent-hierarchy was defined
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException

transformElement

org.w3c.dom.Node transformElement(org.w3c.dom.Element element,
                                  ParserContext<B> parserContext,
                                  DefinitionBuilder definitionBuilder)
                                  throws XmlParserParsingException
Transforms an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Returns:
Node of the transformed element (defined against DefinitionBuilder.getDocument() Document), null if element should be removed from returning Document
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException

transformElement

org.w3c.dom.Node transformElement(org.w3c.dom.Element element,
                                  java.lang.String localName,
                                  ParserContext<B> parserContext,
                                  DefinitionBuilder definitionBuilder)
                                  throws XmlParserParsingException
Transforms an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
localName - Name, as String, of the actual element
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Returns:
Node of the transformed element (defined against DefinitionBuilder.getDocument() Document), null if element should be removed from returning Document
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException

transformElement

org.w3c.dom.Node transformElement(org.w3c.dom.Element element,
                                  java.lang.String localName,
                                  javax.xml.namespace.QName parent,
                                  ParserContext<B> parserContext,
                                  DefinitionBuilder definitionBuilder)
                                  throws XmlParserParsingException
Transforms an element. Method is called if a element combination namespace-tag (optional with parent hierarchy) is found

Parameters:
element - Element which was found
localName - Name, as String, of the actual element
parent - QName instance of the parent element, null if no parent-hierarchy was defined
parserContext - ParserContext instance which was given to the XmlParser instance
definitionBuilder - DefinitionBuilder instance which was given to the XmlParser instance
Returns:
Node of the transformed element (defined against DefinitionBuilder.getDocument() Document), null if element should be removed from returning Document
Throws:
XmlParserParsingException - Is thrown when some error occurs. Implementation specific exceptions are wrapped into XmlParserParsingException


Copyright © 2010. All Rights Reserved.