Package org.jibx.runtime
Class QName
java.lang.Object
org.jibx.runtime.QName
Representation of a qualified name. This includes the JiBX serializer/deserializer methods for the representation. It assumes that the actual namespace declarations are being handled separately for marshalling
Note that this implementation treats only the namespace and local name as significant for purposes of comparing values. The prefix is held only as a convenience, and the actual prefix used when writing a value may differ from the prefix defined by the instance.
- Author:
- Dennis M. Sosnoski
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QName
deserialize
(String text, IUnmarshallingContext ictx) JiBX deserializer method.static QName[]
deserializeList
(String text, IUnmarshallingContext ictx) JiBX deserializer method.boolean
getName()
Get local name.Get namespace prefix.getUri()
Get namespace URI.int
hashCode()
static String
serialize
(QName qname, IMarshallingContext ictx) JiBX serializer method.static String
serializeList
(QName[] qnames, IMarshallingContext ictx) JiBX serializer method.void
Set local name.void
Set namespace prefix.void
Set namespace URI.toString()
-
Field Details
-
m_uri
Namespace URI. -
m_prefix
Namespace prefix. -
m_name
Local name.
-
-
Constructor Details
-
QName
Constructor from full set of components.- Parameters:
uri
- namespace uri,null
if no-namespace namespaceprefix
- namespace prefix,null
if unspecified, empty string if default namespacename
- local name
-
QName
Constructor from namespace and local name. This constructor is provided as a convenience for when the actual prefix used for a namespace is irrelevant.- Parameters:
uri
- namespace uri,null
if no-namespace namespacename
-
-
QName
Constructor from local name only. This constructor is provided as a convenience for names in the no-namespace namespace.- Parameters:
name
-
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getName
Get local name.- Returns:
- name
-
setName
Set local name.- Parameters:
name
- name
-
getPrefix
Get namespace prefix.- Returns:
- prefix,
null
if unspecified, empty string if default namespace
-
setPrefix
Set namespace prefix.- Parameters:
prefix
- prefix,null
if unspecified, empty string if default namespace
-
getUri
Get namespace URI.- Returns:
- uri namespace uri,
null
if no-namespace namespace
-
setUri
Set namespace URI.- Parameters:
uri
- namespace uri,null
if no-namespace namespace
-
deserialize
JiBX deserializer method. This is intended for use as a deserializer for instances of the class.- Parameters:
text
- value textictx
- unmarshalling context- Returns:
- created class instance
- Throws:
JiBXException
- on error in unmarshalling
-
serialize
JiBX serializer method. This is intended for use as a serializer for instances of the class. The namespace must be active in the output document at the point where this is called.- Parameters:
qname
- value to be serializedictx
- unmarshalling context- Returns:
- created class instance
- Throws:
JiBXException
- on error in marshalling
-
deserializeList
JiBX deserializer method. This is intended for use as a deserializer for a list made up of instances of the class.- Parameters:
text
- value textictx
- unmarshalling context- Returns:
- array of instances
- Throws:
JiBXException
- on error in marshalling
-
serializeList
JiBX serializer method. This is intended for use as a serializer for a list made up of instances of the class. The namespace must be active in the output document at the point where this is called.- Parameters:
qnames
- array of names to be serializedictx
- unmarshalling context- Returns:
- generated text
- Throws:
JiBXException
- on error in marshalling
-