org.eclipse.cosmos.rm.validation.internal.databuilders
Class RootElementAliasLookupBuilder
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractDataBuilder
org.eclipse.cosmos.rm.validation.internal.databuilders.RootElementAliasLookupBuilder
- All Implemented Interfaces:
- IDataBuilder, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class RootElementAliasLookupBuilder
- extends AbstractDataBuilder
- implements IDataBuilder
This builder will build a lookup map that will key on alias names. The value is the
root element name of the document.
|
Method Summary |
void |
characters(char[] ch,
int start,
int len)
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
java.lang.Object |
getDataStructure()
Returns the data structure. |
byte |
getPhase()
Specifies the phase that this data builder is active during parsing. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
This is used to determine the target name space of the document currently
being parsed |
| Methods inherited from class org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractDataBuilder |
appendToErrorMessage, comment, endDefinitions, endInstances, getCurrentPhase, getDefaultNamespace, getErrorMessage, getFilePath, getPrefixMap, getTargetNamespace, isStructureValid, setDefaultNamespace, setDocumentLocator, setErrorMessage, setFilePath, setPrefixMap, setStructureValidity, setTargetNamespace, startDefinitions, startInstances, tokenizeName |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
targetElements
protected java.util.List targetElements
rootDocElement
protected java.lang.String[] rootDocElement
currentTargetElement
protected ElementNode currentTargetElement
aliasFound
protected boolean aliasFound
dataFound
protected boolean dataFound
rootElem
protected boolean rootElem
RootElementAliasLookupBuilder
public RootElementAliasLookupBuilder()
getDataStructure
public java.lang.Object getDataStructure()
- Description copied from interface:
IDataBuilder
- Returns the data structure. The type of the structure must be specified as
part of the specification of the class that implements this interface.
- Specified by:
getDataStructure in interface IDataBuilder
- Returns:
- The data structure
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Description copied from class:
AbstractDataBuilder
- This is used to determine the target name space of the document currently
being parsed
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Overrides:
startElement in class AbstractDataBuilder
- Throws:
org.xml.sax.SAXException- See Also:
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
characters
public void characters(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException
- Specified by:
characters in interface org.xml.sax.ContentHandler- Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Specified by:
endElement in interface org.xml.sax.ContentHandler- Overrides:
endElement in class AbstractDataBuilder
- Throws:
org.xml.sax.SAXException- See Also:
DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
getPhase
public byte getPhase()
- Description copied from interface:
IDataBuilder
- Specifies the phase that this data builder is active during parsing. The parser parses the sml
document in two parts: Definitions and Instances phases. The valid values are as follows:
ISMLConstants.DEFINITIONS_PHASE -databuilder is active during the parsing of the definitions elements
ISMLConstants.INSTANCES_PHASE -databuilder is active during the parsing of the instances elements
ISMLConstants.DEFINITIONS_INSTANCES_PHASE - databuilder is active during the parsing of the definitions and instances elements
- Specified by:
getPhase in interface IDataBuilder- Overrides:
getPhase in class AbstractDataBuilder
- Returns:
- a phase that this databuilder will be active
- See Also:
IDataBuilder.getPhase()