COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.validation.internal.databuilders
Class AbstractPropertyExtractor

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractDataBuilder
          extended by org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractPropertyExtractor
All Implemented Interfaces:
IDataBuilder, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
AcyclicDataTypesList, ComplexTypeElementBuilder, RefTypeElementBuilder, SubstitutionBuilder, TargetElementBuilder, TargetRequiredBuilder, TargetTypeBuilder

public class AbstractPropertyExtractor
extends AbstractDataBuilder
implements IDataBuilder

This abstract property extractor will extract a set of elements/attribute values based on a set of conditions specified (e.g. the value of the name attribute for elements that have acyclic set to true)


Field Summary
protected  java.lang.String elementName
          The element name
 
Fields inherited from class org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractDataBuilder
locator
 
Constructor Summary
AbstractPropertyExtractor(byte phase, java.lang.String elementName, java.lang.String[][] attributes, java.lang.String[] keyValuePair)
          Constructor
 
Method Summary
 java.lang.Object getDataStructure()
          Returns the data structure.
protected  java.lang.Object getMapDataStructure()
          Returns the map version of the entries stored.
 byte getPhase()
          Specifies the phase that this data builder is active during parsing.
protected  java.lang.String getValueToStoreNS()
           
 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, endElement, 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
characters, 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.eclipse.cosmos.rm.validation.internal.databuilders.IDataBuilder
endDefinitions, endInstances, getErrorMessage, getFilePath, isStructureValid, setErrorMessage, setFilePath, setStructureValidity, startDefinitions, startInstances
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 

Field Detail

elementName

protected java.lang.String elementName
The element name

Constructor Detail

AbstractPropertyExtractor

public AbstractPropertyExtractor(byte phase,
                                 java.lang.String elementName,
                                 java.lang.String[][] attributes,
                                 java.lang.String[] keyValuePair)
Constructor

Parameters:
phase - The phase that this builder should operate in (see ISMLConstants.*PHASE)
elementName - The expected element name
attributes - The expected attribute name and values
keyValuePair - The key/value pair to store. Must be of length 2
Method Detail

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)

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
See Also:
IDataBuilder.getDataStructure()

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:
AbstractDataBuilder.getPhase()

getMapDataStructure

protected java.lang.Object getMapDataStructure()
Returns the map version of the entries stored. The map object contains the following: KEY = The URI of a namespace (or an empty string for type nodes that don't have a uri) VALUE = A Map containing the following: KEY = A string indicating the type VALUE = The expected value stored

Returns:
The map version of the entries stored

getValueToStoreNS

protected java.lang.String getValueToStoreNS()

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification