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

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

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.TypeInheritanceDataBuilderImpl
All Implemented Interfaces:
IDataBuilder, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class TypeInheritanceDataBuilderImpl
extends AbstractDataBuilder
implements IDataBuilder

Used to build an inheritance map that will indicate the relationships between the reference types.


Field Summary
static java.lang.String ID
          The static ID of this builder
 
Fields inherited from class org.eclipse.cosmos.rm.validation.internal.databuilders.AbstractDataBuilder
locator
 
Constructor Summary
TypeInheritanceDataBuilderImpl()
          Constructor
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 java.lang.Object getDataStructure()
          The data structure is a Map, where KEY = An object of type String indicating a reference VALUE = An object of type String indicating the immediate parent of KEY
 byte getPhase()
          Specifies the phase that this data builder is active during parsing.
static boolean isDerivedType(java.util.Map inheritanceMap, TypeNode refType, TypeNode refTypeInQuestion)
          Based on the inheritance map passed in, this method will return true if and only if refTypeInQuestion is a derived type of refType.
static TypeNode retrieveType(java.util.Map inheritance, java.lang.String uri, java.lang.String localName)
           
 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
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, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 

Field Detail

ID

public static final java.lang.String ID
The static ID of this builder

See Also:
Constant Field Values
Constructor Detail

TypeInheritanceDataBuilderImpl

public TypeInheritanceDataBuilderImpl()
Constructor

Method Detail

getDataStructure

public java.lang.Object getDataStructure()
The data structure is a Map, where KEY = An object of type String indicating a reference VALUE = An object of type String indicating the immediate parent of KEY

Specified by:
getDataStructure in interface IDataBuilder
Returns:
The data structure
See Also:
IDataBuilder.getDataStructure()

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)

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)

isDerivedType

public static boolean isDerivedType(java.util.Map inheritanceMap,
                                    TypeNode refType,
                                    TypeNode refTypeInQuestion)
Based on the inheritance map passed in, this method will return true if and only if refTypeInQuestion is a derived type of refType.

Parameters:
inheritanceMap - The inheritance map
refType - A primary ref type
refTypeInQuestion - The reference type in question
Returns:
true iff refTypeInQuestion is a derived type of refType; false otherwise

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()

retrieveType

public static TypeNode retrieveType(java.util.Map inheritance,
                                    java.lang.String uri,
                                    java.lang.String localName)

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