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

org.eclipse.cosmos.rm.validation.internal.databuilders
Interface IDataBuilder

All Superinterfaces:
org.xml.sax.ContentHandler
All Known Implementing Classes:
AbstractDataBuilder, AbstractPropertyExtractor, AcyclicDataTypesList, ComplexTypeElementBuilder, DocumentDOMBuilder, ElementSchematronCacheBuilder, ElementSourceBuilder, ElementTypeMapDataBuilder, IdentityConstraintDataBuilder, IdentityDataBuilder, NamespaceContextBuilder, ReferenceExtractor, ReferenceGraphDataBuilder, RefTypeElementBuilder, RootElementAliasLookupBuilder, SMLValidatingBuilder, SubstitutionBuilder, TargetElementBuilder, TargetInstanceBuilder, TargetRequiredBuilder, TargetSchemaBuilder, TargetTypeBuilder, TypeInheritanceDataBuilderImpl

public interface IDataBuilder
extends org.xml.sax.ContentHandler

This interface is used to represent a data builder which will construct a data structure while an SML document is being parsed.


Method Summary
 void endDefinitions()
          This method will be called when the parser ends parsing the definitions part of the document
 void endInstances()
          This method will be called when the parser ends parsing the instances part of the document
 java.lang.Object getDataStructure()
          Returns the data structure.
 IValidationMessage getErrorMessage()
          Returns the error message set.
 java.lang.String getFilePath()
          Retrieves the path of the current file being processed
 byte getPhase()
          Specifies the phase that this data builder is active during parsing.
 boolean isStructureValid()
          Returns true if this structure is valid.
 void setErrorMessage(IValidationMessage message)
          Sets an error message in case the structure is not valid
 void setFilePath(java.lang.String filePath)
          Sets the path of the current file being processed
 void setStructureValidity(boolean validity)
          Sets the structure validity
 void startDefinitions()
          This method will be called when the parser starts parsing the definition part of the document
 void startInstances()
          This method will be called when the parser starts parsing the instances part of the document
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 

Method Detail

getDataStructure

java.lang.Object getDataStructure()
Returns the data structure. The type of the structure must be specified as part of the specification of the class that implements this interface.

Returns:
The data structure

startDefinitions

void startDefinitions()
This method will be called when the parser starts parsing the definition part of the document


startInstances

void startInstances()
This method will be called when the parser starts parsing the instances part of the document


endDefinitions

void endDefinitions()
This method will be called when the parser ends parsing the definitions part of the document


endInstances

void endInstances()
This method will be called when the parser ends parsing the instances part of the document


getPhase

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

Returns:
a phase that this databuilder will be active

isStructureValid

boolean isStructureValid()
Returns true if this structure is valid. An error message is usually set if this method returns false.


setStructureValidity

void setStructureValidity(boolean validity)
Sets the structure validity

Parameters:
validity - The validity of the structure

setErrorMessage

void setErrorMessage(IValidationMessage message)
Sets an error message in case the structure is not valid

Parameters:
error - The error message

getErrorMessage

IValidationMessage getErrorMessage()
Returns the error message set. This value can be null if no error message has been set.

Returns:
The error message

setFilePath

void setFilePath(java.lang.String filePath)
Sets the path of the current file being processed

Parameters:
filePath - The path

getFilePath

java.lang.String getFilePath()
Retrieves the path of the current file being processed

Returns:
The path of the file being processed

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