Package org.jibx.binding.def
Class NameDefinition
java.lang.Object
org.jibx.binding.def.NameDefinition
Named value definition from binding. This is a component of all items
in the mapping corresponding to elements or attributes in the document.
- Author:
- Dennis M. Sosnoski
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finds the index for the namespace used with a name.void
Generate code to push namespace index followed by name.void
Generate code to push name.void
Generate code to push namespace URI.void
Generate code to push namespace URI followed by name.getName()
Get the local name.Get the namespace URI.boolean
Check if namespace URI is null.toString()
-
Field Details
-
m_name
Element or attribute name. -
m_namespace
Element or attribute namespace URI. -
m_isAttribute
private final boolean m_isAttributeFlag for attribute name. -
m_namespaceIndex
private int m_namespaceIndexNamespace index used for marshalling (derived from nesting).
-
-
Constructor Details
-
NameDefinition
Constructor.- Parameters:
name
-ns
-attr
- flag for attribute name
-
-
Method Details
-
getName
Get the local name.- Returns:
- name
-
getNamespace
Get the namespace URI.- Returns:
- namespace (
null
if no-namespace namespace)
-
isNullUri
public boolean isNullUri()Check if namespace URI is null.- Returns:
true
if URI null,false
if not
-
genPushUri
Generate code to push namespace URI.- Parameters:
mb
- method builder
-
genPushName
Generate code to push name.- Parameters:
mb
- method builder
-
genPushUriPair
Generate code to push namespace URI followed by name.- Parameters:
mb
- method builder
-
genPushIndexPair
Generate code to push namespace index followed by name.- Parameters:
mb
- method builder
-
fixNamespace
Finds the index for the namespace used with a name. If no explicit namespace has been set it uses the appropriate default. This is a separate operation from the unmarshalling in order to properly handle namespace definitions as children of the named binding component.- Parameters:
defc
- definition context for namespaces- Throws:
JiBXException
- if error in namespace handling
-
toString
-