org.jibx.binding.def
Class NameDefinition

java.lang.Object
  extended by org.jibx.binding.def.NameDefinition

public class NameDefinition
extends Object

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

Constructor Summary
NameDefinition(String name, String ns, boolean attr)
          Constructor.
 
Method Summary
 void fixNamespace(DefinitionContext defc)
          Finds the index for the namespace used with a name.
 void genPushIndexPair(MethodBuilder mb)
          Generate code to push namespace index followed by name.
 void genPushName(MethodBuilder mb)
          Generate code to push name.
 void genPushUri(MethodBuilder mb)
          Generate code to push namespace URI.
 void genPushUriPair(MethodBuilder mb)
          Generate code to push namespace URI followed by name.
 String getName()
          Get the local name.
 String getNamespace()
          Get the namespace URI.
 boolean isNullUri()
          Check if namespace URI is null.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameDefinition

public NameDefinition(String name,
                      String ns,
                      boolean attr)
Constructor.

Parameters:
name -
ns -
attr - flag for attribute name
Method Detail

getName

public String getName()
Get the local name.

Returns:
name

getNamespace

public String 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

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 String toString()
Overrides:
toString in class Object


Copyright © 2005-2011 jibx.org. All Rights Reserved.