public class LatticeXmlParser
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
s_strAttrAuth |
static java.lang.String |
s_strAttrDate |
static java.lang.String |
s_strAttrId |
static java.lang.String |
s_strAttrLen |
static java.lang.String |
s_strAttrName |
static java.lang.String |
s_strAttrSep |
static java.lang.String |
s_strAttrText |
static java.lang.String |
s_strAttrType |
static java.lang.String |
s_strAttrVal |
static java.lang.String |
s_strAttrVer |
static java.lang.String |
s_strElemComm |
static java.lang.String |
s_strElemElem |
static java.lang.String |
s_strElemLatt
Attributes for XAL/MODEL/LATTICE DTD
|
static java.lang.String |
s_strElemParam |
static java.lang.String |
s_strElemSeq |
| Constructor and Description |
|---|
LatticeXmlParser()
Creates a new instance of LatticeXmlParser
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addParameter(DataAdaptor dapt,
java.lang.String strName,
java.lang.String strType,
java.lang.String strValue)
Add a parameter child to a DataAdaptor
|
protected java.lang.String |
attrValue(DataAdaptor dapt,
java.lang.String strAttrName)
Returns the attribute value string from a DataAdaptor interface.
|
protected java.lang.String |
buildComment(DataAdaptor daptComm)
Return the comment string from a comment element within a sequence.
|
protected IElement |
buildElement(DataAdaptor daptElem)
Build a IElement object according to parameters specified in a data
adaptor.
|
protected ElementSeq |
buildSequence(DataAdaptor daptSeq)
Build a sequence with its elements from a data source represented by a
DataAdaptor interface.
|
protected void |
loadComposite(IComposite secNew,
DataAdaptor daptSeq)
Load an ElementSeq object with it's components
|
protected void |
loadElement(IElement elem,
DataAdaptor daptElem)
Load an IElement object with its parameters specified in the
data adaptor.
|
static Lattice |
parse(java.lang.String fileUri,
boolean bolValidate)
Parses the XML file specified by the supplied URI.
|
Lattice |
parseAdaptor(DataAdaptor adaptor)
Parses the given data source for modeling lattice information
and creates the corresponding lattice.
|
static Lattice |
parseDataAdaptor(DataAdaptor adaptor)
Parses the supplied DataAdaptor and return a
Lattice object configured according to the Adaptor. |
Lattice |
parseUrl(java.lang.String strFile,
boolean bolValidate)
Parse an XAL Model lattice file and build the corresponding Lattice object.
|
public static final java.lang.String s_strElemLatt
public static final java.lang.String s_strElemSeq
public static final java.lang.String s_strElemElem
public static final java.lang.String s_strElemParam
public static final java.lang.String s_strElemComm
public static final java.lang.String s_strAttrId
public static final java.lang.String s_strAttrLen
public static final java.lang.String s_strAttrVer
public static final java.lang.String s_strAttrAuth
public static final java.lang.String s_strAttrDate
public static final java.lang.String s_strAttrText
public static final java.lang.String s_strAttrName
public static final java.lang.String s_strAttrType
public static final java.lang.String s_strAttrVal
public static final java.lang.String s_strAttrSep
public LatticeXmlParser()
public static Lattice parse(java.lang.String fileUri, boolean bolValidate) throws ParsingException
Lattice object configured according to the file.fileUri - the URI specifying the XML file to parsebolValidate - apply XML DTD validationParsingException - An exception was encountered in parsingpublic static Lattice parseDataAdaptor(DataAdaptor adaptor) throws ParsingException
Lattice object configured according to the Adaptor.adaptor - the DataAdaptor containing the Lattice definitionParsingException - An exception was encountered in parsingpublic Lattice parseUrl(java.lang.String strFile, boolean bolValidate) throws ParsingException
strFile - URL of lattice description filebolValidate - apply XML DTD validationParsingException - An exception was encountered in parsingpublic Lattice parseAdaptor(DataAdaptor adaptor) throws ParsingException
adaptor - data source containing the modeling latticeParsingException - general format exceptionprotected ElementSeq buildSequence(DataAdaptor daptSeq) throws DataFormatException, java.lang.NumberFormatException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.NoSuchMethodException
daptSeq - data source containing sequence structureDataFormatException - data does not conform to XAL_MODEL.DTD specificationjava.lang.NumberFormatException - numeric parameter is malformed and unparsablejava.lang.ClassNotFoundException - an unknown Element type was encounteredjava.lang.InstantiationException - unable to instantiate an IElement instancejava.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encounteredprotected java.lang.String buildComment(DataAdaptor daptComm)
daptComm - data adaptor containing comment elementMissingDataException - an attribute was missing from the commentprotected IElement buildElement(DataAdaptor daptElem) throws java.lang.InstantiationException, java.lang.ClassNotFoundException, DataFormatException, java.lang.NoSuchMethodException
daptElem - data adaptor containing element parametersjava.lang.InstantiationException - unable to instantiate an IElement instancejava.lang.ClassNotFoundException - an unknown IElement type was encounteredDataFormatException - bad parameter format encounteredjava.lang.NoSuchMethodException - unknown or invalid Parameter for an IElement was encounteredprotected void loadComposite(IComposite secNew, DataAdaptor daptSeq) throws DataFormatException, java.lang.NumberFormatException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException
seqNew - ElementSeq object to be loadeddaptSeq - data adaptor containing sequence informationjava.lang.ClassNotFoundException - an unknown Element type was encounteredDataFormatException - bad parameter formatjava.lang.NumberFormatException - bad number format in parameter valuejava.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encounteredjava.lang.InstantiationExceptionprotected void loadElement(IElement elem, DataAdaptor daptElem) throws DataFormatException, java.lang.NoSuchMethodException, java.lang.NumberFormatException
elem - IElement object to have parameter assigneddaptElem - data adaptor containing all parameter information for elementDataFormatException - bad paramter formatjava.lang.NumberFormatException - numeric value was malformed and unparseablejava.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encounteredprotected java.lang.String attrValue(DataAdaptor dapt, java.lang.String strAttrName) throws MissingDataException
strAttrName - attribute nameMissingDataException - specified attribute not present in DataAdaptorprotected static void addParameter(DataAdaptor dapt, java.lang.String strName, java.lang.String strType, java.lang.String strValue)