Package org.jibx.binding.def
Class NameDefinition
- java.lang.Object
-
- org.jibx.binding.def.NameDefinition
-
public class NameDefinition extends java.lang.ObjectNamed 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 Modifier and Type Field Description private booleanm_isAttributeFlag for attribute name.private java.lang.Stringm_nameElement or attribute name.private java.lang.Stringm_namespaceElement or attribute namespace URI.private intm_namespaceIndexNamespace index used for marshalling (derived from nesting).
-
Constructor Summary
Constructors Constructor Description NameDefinition(java.lang.String name, java.lang.String ns, boolean attr)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfixNamespace(DefinitionContext defc)Finds the index for the namespace used with a name.voidgenPushIndexPair(MethodBuilder mb)Generate code to push namespace index followed by name.voidgenPushName(MethodBuilder mb)Generate code to push name.voidgenPushUri(MethodBuilder mb)Generate code to push namespace URI.voidgenPushUriPair(MethodBuilder mb)Generate code to push namespace URI followed by name.java.lang.StringgetName()Get the local name.java.lang.StringgetNamespace()Get the namespace URI.booleanisNullUri()Check if namespace URI is null.java.lang.StringtoString()
-
-
-
Field Detail
-
m_name
private final java.lang.String m_name
Element or attribute name.
-
m_namespace
private java.lang.String m_namespace
Element or attribute namespace URI.
-
m_isAttribute
private final boolean m_isAttribute
Flag for attribute name.
-
m_namespaceIndex
private int m_namespaceIndex
Namespace index used for marshalling (derived from nesting).
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the local name.- Returns:
- name
-
getNamespace
public java.lang.String getNamespace()
Get the namespace URI.- Returns:
- namespace (
nullif no-namespace namespace)
-
isNullUri
public boolean isNullUri()
Check if namespace URI is null.- Returns:
trueif URI null,falseif not
-
genPushUri
public void genPushUri(MethodBuilder mb)
Generate code to push namespace URI.- Parameters:
mb- method builder
-
genPushName
public void genPushName(MethodBuilder mb)
Generate code to push name.- Parameters:
mb- method builder
-
genPushUriPair
public void genPushUriPair(MethodBuilder mb)
Generate code to push namespace URI followed by name.- Parameters:
mb- method builder
-
genPushIndexPair
public void genPushIndexPair(MethodBuilder mb)
Generate code to push namespace index followed by name.- Parameters:
mb- method builder
-
fixNamespace
public void fixNamespace(DefinitionContext defc) throws JiBXException
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-