public class TreeBuilder extends Object implements DocDefHandler, TreeParser, HasPrefixGuesser
| Modifier and Type | Method and Description |
|---|---|
void |
addExtraDataCurLink(Object data) |
void |
addExtraDataCurLink(Object[] data) |
void |
addExtraDataNode(String uniqueName,
String typeName,
Object data) |
void |
addExtraDataNode(String uniqueName,
String typeName,
Object[] data) |
void |
character(char c)
Called each time a character | is found.
|
boolean |
doesElementExist(String typeName)
Does this element exist at this point? Either thru a startElement() creation,
or thru an element() reference.
|
String |
dump() |
void |
element(String uniqueName,
String typeName,
int instance) |
void |
element(String uniqueName,
String typeName,
String attrName,
String attrNamespace,
int instance,
boolean externalType,
String defaultValue)
Called for each word found in a DTD definition.
|
void |
endDocument()
Called when the DTD parsing is over.
|
void |
endElement()
Done with an element
|
void |
endGroupElements(int instance)
We are done creating the elements of a same group,
set the current link to the parent of the group.
|
String |
getDefaultNamespace()
Get the namespace that will be used by default in the documents.
|
GraphNode |
getNode(String uniqueName)
Return a specific GraphNode.
|
GraphNode[] |
getNodes()
TreeParser interface.
|
PrefixGuesser |
getPrefixGuesser() |
GraphNode |
getRoot()
Return the root of the DTD object graph.
|
void |
javaType(String uniqueName,
String name,
String javaType)
Called to request that the graph node named name be of a certain
Java class.
|
void |
nillable(boolean value) |
void |
setAbstract(String uniqueName,
String name,
boolean value) |
void |
setDefaultNamespace(String ns)
Set the namespace that will be used by default in the documents.
|
void |
setExtendedProperty(String uniqueName,
String typeName,
String propertyName,
Object value)
set an extended property on a GraphNode
|
void |
setExtension(String uniqueName,
String typeName,
String extendsName) |
void |
setPrefixGuesser(PrefixGuesser guesser)
Establish a prefix guesser
|
void |
setUnion(String uniqueName,
String typeName,
boolean value) |
void |
startDocument(String root)
Called once, when the DTD is started to be parsed.
|
void |
startElement(String uniqueName,
String typeName,
int type)
Called each time a DTD
|
void |
startGroupElements()
Called when a parenthese is found, meaning that the following
elements (element() calls) should be considered as semantically
grouped.
|
public void startDocument(String root)
startDocument in interface DocDefHandlerroot - root elemement name of the document (as the DOCTYPE
specifies in the XML document)public void endDocument()
endDocument in interface DocDefHandlerpublic void startElement(String uniqueName, String typeName, int type)
startElement in interface DocDefHandlername - the name of the elementtypeName - is the name to use for the attributetype - the type (as a constant) of the element (for example
ELEMENT or ATTLIST)public boolean doesElementExist(String typeName)
DocDefHandlerdoesElementExist in interface DocDefHandlerpublic void endElement()
endElement in interface DocDefHandlerpublic void character(char c)
character in interface DocDefHandlerpublic void element(String uniqueName, String typeName, String attrName, String attrNamespace, int instance, boolean externalType, String defaultValue)
element in interface DocDefHandlername - the name of the element defined within the
declaration.instance - has one of the three values: TYPE_0_1,
TYPE_1, TYPE_0_N, TYPE_1_Npublic void element(String uniqueName, String typeName, int instance)
element in interface DocDefHandlerpublic void addExtraDataNode(String uniqueName, String typeName, Object data) throws Schema2BeansException
addExtraDataNode in interface DocDefHandlerSchema2BeansExceptionpublic void addExtraDataCurLink(Object data)
addExtraDataCurLink in interface DocDefHandlerpublic void addExtraDataNode(String uniqueName, String typeName, Object[] data) throws Schema2BeansException
Schema2BeansExceptionpublic void setUnion(String uniqueName, String typeName, boolean value) throws Schema2BeansException
setUnion in interface DocDefHandlerSchema2BeansExceptionpublic void addExtraDataCurLink(Object[] data)
public void nillable(boolean value)
nillable in interface DocDefHandlerpublic void setAbstract(String uniqueName, String name, boolean value)
setAbstract in interface DocDefHandlerpublic void setExtendedProperty(String uniqueName, String typeName, String propertyName, Object value) throws Schema2BeansException
setExtendedProperty in interface DocDefHandlerSchema2BeansExceptionpublic void javaType(String uniqueName, String name, String javaType)
javaType in interface DocDefHandlerjavaType - is the name of a Java class (eg, "java.lang.Integer", or "int").public void setExtension(String uniqueName, String typeName, String extendsName) throws Schema2BeansException
setExtension in interface DocDefHandlerSchema2BeansExceptionpublic void startGroupElements()
startGroupElements in interface DocDefHandlerpublic void endGroupElements(int instance)
endGroupElements in interface DocDefHandlerpublic void setDefaultNamespace(String ns)
DocDefHandlersetDefaultNamespace in interface DocDefHandlerpublic String getDefaultNamespace()
TreeParsergetDefaultNamespace in interface TreeParserpublic GraphNode[] getNodes()
getNodes in interface TreeParserpublic GraphNode getNode(String uniqueName)
TreeParsergetNode in interface TreeParserpublic GraphNode getRoot()
TreeParsergetRoot in interface TreeParserpublic String dump()
public void setPrefixGuesser(PrefixGuesser guesser)
DocDefHandlersetPrefixGuesser in interface DocDefHandlerpublic PrefixGuesser getPrefixGuesser()
getPrefixGuesser in interface HasPrefixGuesserCopyright © 2017. All Rights Reserved.