Package schema2template.model
Class QNameValue
- java.lang.Object
-
- schema2template.model.QNameValue
-
- All Implemented Interfaces:
Comparable<QNameValue>
,QNamed
public class QNameValue extends Object implements QNamed, Comparable<QNameValue>
Domain specific models (Odf, Java, ...) often return 'ns:localname' Strings. The purpose of this class is to encapsulate these Strings so in templates they can be treated like other QNamed objects.Contract: These objects are distincted only by the encapsulated String. So they use this String for equals(o), hashCode() and compareTo(o).
-
-
Constructor Summary
Constructors Constructor Description QNameValue(String name)
Constructor to create a String wrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(QNameValue o)
boolean
equals(Object o)
String
getLocalName()
Get only localnameString
getNamespace()
Get only namespaceString
getQName()
Get the QName (i.e.int
hashCode()
-
-
-
Constructor Detail
-
QNameValue
public QNameValue(String name)
Constructor to create a String wrapper- Parameters:
name
- the String to wrap
-
-
Method Detail
-
getLocalName
public String getLocalName()
Description copied from interface:QNamed
Get only localname- Specified by:
getLocalName
in interfaceQNamed
- Returns:
- localname
-
getQName
public String getQName()
Description copied from interface:QNamed
Get the QName (i.e. namespace:localname )
-
getNamespace
public String getNamespace()
Description copied from interface:QNamed
Get only namespace- Specified by:
getNamespace
in interfaceQNamed
- Returns:
- namespace
-
compareTo
public int compareTo(QNameValue o)
- Specified by:
compareTo
in interfaceComparable<QNameValue>
-
-