|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.xml.LatticeXmlParser
Utility class for building an XAL Model Lattice from a corresponding XML file.
| Field Summary | |
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 Summary | |
LatticeXmlParser()
Creates a new instance of LatticeXmlParser |
|
| Method Summary | |
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)
|
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
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
| Constructor Detail |
public LatticeXmlParser()
| Method Detail |
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 validation
ParsingException - An exception was encountered in parsing
public static Lattice parseDataAdaptor(DataAdaptor adaptor)
throws ParsingException
Lattice object configured according to the Adaptor.
adaptor - the DataAdaptor containing the Lattice definition
ParsingException - An exception was encountered in parsing
public Lattice parseUrl(java.lang.String strFile,
boolean bolValidate)
throws ParsingException
strFile - URL of lattice description filebolValidate - apply XML DTD validation
ParsingException - An exception was encountered in parsing
public Lattice parseAdaptor(DataAdaptor adaptor)
throws ParsingException
ParsingException
protected ElementSeq buildSequence(DataAdaptor daptSeq)
throws DataFormatException,
java.lang.NumberFormatException,
java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.NoSuchMethodException
daptSeq - data source containing sequence structure
DataFormatException - data does not conform to XAL_MODEL.DTD specification
java.lang.NumberFormatException - numeric parameter is malformed and unparsable
java.lang.ClassNotFoundException - an unknown Element type was encountered
java.lang.InstantiationException - unable to instantiate an IElement instance
java.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encounteredprotected java.lang.String buildComment(DataAdaptor daptComm)
daptComm - data adaptor containing comment element
MissingDataException - an attribute was missing from the comment
protected IElement buildElement(DataAdaptor daptElem)
throws java.lang.InstantiationException,
java.lang.ClassNotFoundException,
DataFormatException,
java.lang.NoSuchMethodException,
java.lang.NumberFormatException
daptElem - data adaptor containing element parameters
java.lang.InstantiationException - unable to instantiate an IElement instance
java.lang.ClassNotFoundException - an unknown IElement type was encountered
DataFormatException - bad parameter format encountered
java.lang.NumberFormatException - bad number format encountered in parameter value
java.lang.NoSuchMethodException - unknown or invalid Parameter for an IElement was encountered
protected void loadComposite(IComposite secNew,
DataAdaptor daptSeq)
throws DataFormatException,
java.lang.NumberFormatException,
java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException
daptSeq - data adaptor containing sequence information
java.lang.ClassNotFoundException - an unknown Element type was encountered
DataFormatException - bad parameter format
java.lang.NumberFormatException - bad number format in parameter value
java.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encountered
java.lang.InstantiationException
protected 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 element
DataFormatException - bad paramter format
java.lang.NumberFormatException - numeric value was malformed and unparseable
java.lang.NoSuchMethodException - unknown or invalid Parameter for an Element was encountered
protected java.lang.String attrValue(DataAdaptor dapt,
java.lang.String strAttrName)
throws MissingDataException
strAttrName - attribute name
MissingDataException - specified attribute not present in DataAdaptor
protected static void addParameter(DataAdaptor dapt,
java.lang.String strName,
java.lang.String strType,
java.lang.String strValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||