public class DataAlias
extends java.lang.Object
implements java.lang.Comparable
XmlResourceCollection
that holds a set of aliases.xml files. The xml looks like:
<aliases> <alias name="TEMP" label="Temperature" aliases="T,t,Temperature,tdry" /> ... </aliases> </pre> Each alias tag holds a name (the canonical name), a label and a comma separated list of aliases for the name.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_ALIASES
Xml attribute for aliases
|
static java.lang.String |
ATTR_LABEL
Xml attribute for label
|
static java.lang.String |
ATTR_NAME
Xml attribute for name
|
static java.lang.String |
TAG_ALIAS
Xml tag for canonical name
|
static java.lang.String |
TAG_ALIASES
Xml tag for aliases
|
Constructor and Description |
---|
DataAlias(java.lang.String name,
java.lang.String label)
Construct a new DataAlias with the given name and label.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAlias(java.lang.String alias)
Add an alias for this object.
|
protected void |
addAliases(java.util.List l)
Add alist of aliases to this
DataAlias |
static java.lang.String |
aliasToCanonical(java.lang.String paramName)
Return the canonical name for the given alias.
|
int |
compareTo(java.lang.Object o)
_more_
|
static java.util.List |
createDataAliases(org.w3c.dom.Element root)
Process the given xml and return a list of DataAlias objects
defined within the xml.
|
boolean |
equals(java.lang.Object o)
See if
o is equal to this. |
static DataAlias |
findAlias(java.lang.String paramName)
Return the DataAlias object the given canonical name.
|
java.util.List |
getAliases()
Get aliases for the name of this
DataAlias |
static java.util.List |
getAliasesOf(java.lang.String paramName)
Return the list of aliases (Strings) for the given canonical.
|
static java.util.List |
getDataAliasList()
Return the list of canonical names (
String -s) |
java.lang.String |
getLabel()
Get the label of this
DataAlias |
static java.util.List |
getLabelIdList()
Return the list of name/label pairs (
TwoFacedObject -s) |
java.lang.String |
getName()
Get the name of this
DataAlias |
int |
hashCode()
Override of hashCode method.
|
static void |
init(XmlResourceCollection resources)
Initialize the DataAlias-es with the given collection
of xml resources,
XmlResourceCollection |
static void |
reInit(XmlResourceCollection resources)
Reinitialize the data structures and reprocess
the xml.
|
void |
setLabel(java.lang.String value)
Set the label of this
DataAlias |
void |
setName(java.lang.String value)
Set the name of this
DataAlias |
java.lang.String |
toString()
Returns a string representation of this DataAlias.
|
public static final java.lang.String TAG_ALIAS
public static final java.lang.String TAG_ALIASES
public static final java.lang.String ATTR_ALIASES
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_LABEL
public DataAlias(java.lang.String name, java.lang.String label)
name
- name of this DataAlias
label
- label of this DataAlias
. Used for displaying
a "nice" string for this DataAlias.protected void addAlias(java.lang.String alias)
alias
- alias to add.protected void addAliases(java.util.List l)
DataAlias
l
- List
of names (String
-s)public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
o
is equal to this.equals
in class java.lang.Object
o
- object in questiono
is a DataAlias and they have the same
name.public void setName(java.lang.String value)
DataAlias
value
- new name.public java.lang.String getName()
DataAlias
public void setLabel(java.lang.String value)
DataAlias
value
- new label.public java.lang.String getLabel()
DataAlias
public java.util.List getAliases()
DataAlias
List
of names.public static java.util.List createDataAliases(org.w3c.dom.Element root)
root
- root element of the XMLpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- _more_public static void reInit(XmlResourceCollection resources)
AliasEditor
when aliases have been changed.resources
- collection of XML resourcespublic static void init(XmlResourceCollection resources)
XmlResourceCollection
resources
- collection of XML resourcespublic static java.util.List getDataAliasList()
String
-s)List
of namespublic static java.util.List getLabelIdList()
TwoFacedObject
-s)List
of namespublic static java.lang.String aliasToCanonical(java.lang.String paramName)
paramName
- alias to look forDataAlias
corresponding to
name
or null
if no match is found.public static java.util.List getAliasesOf(java.lang.String paramName)
paramName
- canonical name (name) to look forList
of aliases for the canonical name.public static DataAlias findAlias(java.lang.String paramName)
paramName
- alias to look forDataAlias
corresponding to
name
or null
if no match is found.public java.lang.String toString()
toString
in class java.lang.Object