|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xtm.XtmNode
org.ceryle.xtm.XtmVariant
public class XtmVariant
Defines a base name variant, such that instances of this class are objects containing the variant names of XtmBaseName objects, designed to assist in building in-memory representations via the XtmProcessor class. XtmVariants are not representations of XTM <variant> Elements. Note that constructors with IDs are not provided for XtmVariants, though the ID can still be set using setID().
An XtmVariant contains one XtmParameters object, which contains all of the XtmReferences acting as parameters of this XtmVariant.
| Field Summary |
|---|
| Fields inherited from class org.ceryle.xtm.XtmNode |
|---|
ASSOCIATION_NODE, BASENAME_NODE, BASENAMESTRING_NODE, COMMENT_NODE, DOCUMENT_NODE, GrpSep, GRPSEP, id, INSTANCEOF_NODE, MEMBER_NODE, MERGEMAP_NODE, NODE, NonType, NONTYPE, OCCURRENCE_NODE, PARAMETERS_NODE, PROCESSING_INSTRUCTION_NODE, RecSep, RECSEP, REFERENCE_NODE, RESOURCEDATA_NODE, RESOURCEREF_NODE, ROLESPEC_NODE, SCOPE_NODE, SUBJECTIDENTITY_NODE, SUBJECTINDICATORREF_NODE, TOPIC_NODE, TOPICMAP_NODE, TOPICREF_NODE, VARIANT_NODE, VARIANTNAME_NODE |
| Constructor Summary | |
|---|---|
XtmVariant()
Default constructor. |
|
XtmVariant(String id)
Constructor with supplied String ID value id. |
|
XtmVariant(XtmParameters params)
Constructor providing an XtmParameters object, used as the parameters of this XtmVariant. |
|
XtmVariant(XtmParameters params,
String data)
XtmVariant constructor provided an XtmParameters params and a String resourceData to be used as the variant name, i.e., the content of a <resourceData> Element within the <variantName> Element. |
|
XtmVariant(XtmParameters params,
XtmReference resourceRef)
XtmVariant constructor provided an XtmParameters params and a XtmReference resourceRef to be used as the contents of a <variantName> Element. |
|
XtmVariant(XtmParameters params,
XtmResourceData resourceData)
XtmVariant constructor provided an XtmParameters params and a XtmResourceData resourceData object to be used as the variant name within the <variantName> Element. |
|
| Method Summary | |
|---|---|
void |
addParameter(XtmReference parameter)
Add an XtmReference parameter as a parameter of this XtmVariant. |
void |
addParameters(XtmParameters params)
Add XtmParameters params as parameters of this XtmVariant. |
void |
addVariant(XtmVariant variant)
Recursively add an XtmVariant variant as a variant of this XtmVariant. |
int |
compareTo(Object o)
Compares the hash of this XtmVariant with the provided Object (which should be another XtmVariant) for order. |
String |
getHash()
Return a coded String that is a hashed version of this XtmVariant. |
String |
getName()
Returns a String containing the name of this XTM element type. |
short |
getNodeType()
A short integer indicating what type of node this is. |
XtmParameters |
getParameters()
Return the XtmParameters object representing the parameters of this XtmVariant. |
XtmNode |
getVariantName()
Return the XtmResourceData or XtmReference representing the resource of this XtmVariant. |
Iterator |
getVariants()
Return an Iterator containing an XtmVariants recursively contained within this one, null if none have been defined. |
boolean |
hasParameter(XtmReference xref)
Return true if an XtmReference object is found amongst the parameters of this variant having a URI string matching the one provided. |
void |
setVariantName(String resourceData)
Set the value of the variant name of this XtmVariant to the XtmResourceData created from the String resourceData. |
void |
setVariantName(XtmReference resourceRef)
Set the value of the variant name of this XtmVariant to the XtmReference resourceRef. |
void |
setVariantName(XtmResourceData resourceData)
Set the value of the variant name of this XtmVariant to the XtmResourceData resourceData. |
| Methods inherited from class org.ceryle.xtm.XtmNode |
|---|
addPI, getID, getPI, getPIs, hasNext, next, remove, removePI, setID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XtmVariant()
throws XtmException
XtmException
public XtmVariant(String id)
throws XtmException
id - the ID of this XtmVariant.
XtmException
public XtmVariant(XtmParameters params)
throws XtmException
params - the XtmParameters used as the parameters of this XtmVariant.
XtmException
public XtmVariant(XtmParameters params,
XtmResourceData resourceData)
throws XtmException
params - the XtmParameters used as the parameters of this XtmVariant.resourceData - the XtmResourceData used as the resource of this XtmVariant.
XtmException
public XtmVariant(XtmParameters params,
String data)
throws XtmException
params - the XtmParameters used as the parameters of this XtmVariant.data - the String used as the resource data of this XtmVariant.
XtmException
public XtmVariant(XtmParameters params,
XtmReference resourceRef)
throws XtmException
params - the XtmParameters used as the parameters of this XtmVariant.resourceRef - the XtmReference used as the resource of this XtmVariant.
XtmException| Method Detail |
|---|
public String getName()
getName in class XtmNodepublic short getNodeType()
getNodeType in class XtmNode
public void addParameter(XtmReference parameter)
throws XtmException
parameter as a parameter of this XtmVariant.
If the XtmParameters object does not exist, this will create one. If one
already exists, this will add the XtmReference to the existing parameters.
XtmExceptionpublic void addParameters(XtmParameters params)
params as parameters of this XtmVariant.
If an XtmParameters object does not exist, the provided one will serve
this role. If one already exists, this will add the XtmReferences contained
within the provided XtmParameters object to the existing parameters.
public XtmParameters getParameters()
public boolean hasParameter(XtmReference xref)
public void setVariantName(XtmResourceData resourceData)
throws XtmException
resourceData - The XtmResourceData to be used as the resource data value.
XtmException - if resourceRef has already been set
public void setVariantName(String resourceData)
throws XtmException
resourceData - The String to be used as the resource data value.
XtmException - if resourceRef has already been set
public void setVariantName(XtmReference resourceRef)
throws XtmException
resourceRef - The XtmReference to be used as the resource reference value.
XtmException - if resourceData has already been setpublic XtmNode getVariantName()
public void addVariant(XtmVariant variant)
variant as a variant of this XtmVariant.
public Iterator getVariants()
public String getHash()
public int compareTo(Object o)
compareTo in interface Comparable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||