| java.lang.Object org.jibx.binding.def.BindingBuilder org.jibx.binding.def.BindingDefinition
BindingDefinition | public class BindingDefinition extends BindingBuilder.ContainerBase implements IContainer(Code) | | Binding definition. This is the root of the object graph for a binding.
author: Dennis M. Sosnoski version: 1.0 |
Constructor Summary | |
public | BindingDefinition(String name, boolean ibind, boolean obind, String tpack, boolean glob, boolean forward, boolean source, boolean force) Constructor. |
CURRENT_VERSION_NAME | final public static String CURRENT_VERSION_NAME(Code) | | Current distribution file name. This is filled in by the Ant build
process to match the current distribution.
|
DEFAULT_AUTOPREFIX | final static String DEFAULT_AUTOPREFIX(Code) | | Default prefix for automatic ID generation.
|
GENERATE_PREFIX | final public static String GENERATE_PREFIX(Code) | | Prefix used in all code generation for methods and classes.
|
BindingDefinition | public BindingDefinition(String name, boolean ibind, boolean obind, String tpack, boolean glob, boolean forward, boolean source, boolean force) throws JiBXException(Code) | | Constructor. Sets all defaults, including the default name provided, and
initializes the definition context for the outermost level of the
binding.
Parameters: name - binding name Parameters: ibind - input binding flag Parameters: obind - output binding flag Parameters: tpack - target package Parameters: glob - global IDs flag Parameters: forward - support forward referenced IDs flag Parameters: source - add source tracking for unmarshalled objects flag Parameters: force - create marshaller/unmarshaller classes for top-levelnon-base mappings throws: JiBXException - if error in transformation |
generateCode | public void generateCode(boolean verbose) throws JiBXException(Code) | | Generate code. First sets linkages and executes code generation for
each top-level mapping defined in this binding, which in turn propagates
the code generation all the way down. Then generates the actual binding
factory for this binding.
TODO: handle unidirectional bindings properly
Parameters: verbose - flag for verbose output throws: JiBXException - if error in code generation |
getBinding | public static BindingDefinition getBinding(int index)(Code) | | Get indexed binding.
Parameters: index - number of binding to be returned binding at the specified index |
getDefaultPackage | public String getDefaultPackage()(Code) | | Get default package used for code generation.
default code generation package |
getDefaultRoot | public File getDefaultRoot()(Code) | | Get root directory for default code generation package.
root for default code generation |
getIdClassIndex | public int getIdClassIndex(String name)(Code) | | Get index for ID'ed class from binding. If the class is not already
included it is first added to the binding. If globally unique IDs are
used this always returns 0 .
Parameters: name - fully qualified name of ID'ed class index number of class |
getIndex | public int getIndex()(Code) | | Get index number of binding.
index number for this binding definition |
getMappedClassIndex | public int getMappedClassIndex(String name)(Code) | | Get index for mapped class from binding. If the class is not already
included in any binding it is first added to the list of bound classes.
All bindings use the same index numbers to allow easy lookup of the
appropriate marshaller and unmarshaller within a particular binding, but
this does mean that all bindings dealing with a common set of classes
need to be compiled together. This uses the same sequence of values as
the
BindingDefinition.getMarshallerUnmarshallerIndex method but differs in that
the values returned by this method are unique per class. This method is
intended for use with <mapping> definitions. It is an error to call
this method after calling the
BindingDefinition.getMarshallerUnmarshallerIndex method.
Parameters: name - fully qualified name of mapped class index number of class |
getMarshallerUnmarshallerIndex | public int getMarshallerUnmarshallerIndex(String clas)(Code) | | Get marshaller/unmarshaller slot index in binding. This uses the same
sequence of values as the
BindingDefinition.getMappedClassIndex method but differs
in that the same class may have more than one marshaller/unmarshaller
slot defined. It's intended for user-defined marshallers/unmarshallers
where use is specific to a particular context. After the slot has been
assigned by this method, the
BindingDefinition.setMarshallerUnmarshallerClasses method must be used to set the actual class names.
Parameters: clas - fully qualified name of class handled bymarshaller/unmarshaller slot number for marshaller/unmarshaller |
getNamespaceUriIndex | public int getNamespaceUriIndex(String uri, String prefix)(Code) | | Get index for namespace URI in binding. If the URI is not already
included it is first added to the binding. The empty namespace URI
is always given index number 0 .
Parameters: uri - namespace URI to be included in binding Parameters: prefix - prefix used with namespace index number of namespace |
getPrefix | public String getPrefix()(Code) | | Get prefix for method or class generation.
prefix for names created by this binding |
hasNamespaces | public boolean hasNamespaces()(Code) | | |
indent | public static void indent(int depth)(Code) | | |
isAddConstructors | public boolean isAddConstructors()(Code) | | Check if default constructor generation is enabled.
true if default constructor generation enabled,false if not |
isContentOrdered | public boolean isContentOrdered()(Code) | | |
isForwards | public boolean isForwards()(Code) | | Check if forward ids are supported by unmarshalling binding.
true if supported, false if not |
isIdGlobal | public boolean isIdGlobal()(Code) | | Check if global ids are used by binding.
true if defined, false if not |
isInput | public boolean isInput()(Code) | | Check if binding is defined for unmarshalling.
true if defined, false if not |
isOutput | public boolean isOutput()(Code) | | Check if binding is defined for marshalling.
true if defined, false if not |
isTrackSource | public boolean isTrackSource()(Code) | | Check if source tracking is supported by unmarshalling binding.
true if defined, false if not |
print | public void print()(Code) | | |
reset | public static void reset()(Code) | | Discard cached information and reset in preparation for a new binding
run.
|
setFactoryLocation | public void setFactoryLocation(String tpack, File root)(Code) | | Set location for binding factory class generation.
Parameters: tpack - target package for generated context factory Parameters: root - target root for generated context factory |
setIdChild | public boolean setIdChild(IComponent child)(Code) | | Set ID property. This parent binding component interface method should
never be called for the binding definition, and will throw a runtime
exception if it is called.
Parameters: child - child defining the ID property false |
setMarshallerUnmarshallerClasses | public void setMarshallerUnmarshallerClasses(int slot, String mclas, String uclas)(Code) | | Set marshaller and unmarshaller class names for slot.
Parameters: slot - assigned marshaller/unmarshaller slot number Parameters: mclas - fully qualified name of marshaller class Parameters: uclas - fully qualified name of unmarshaller class |
setSchemaInstanceUsed | public void setSchemaInstanceUsed()(Code) | | Set flag for schema instance namespace used in binding.
|
Methods inherited from org.jibx.binding.def.BindingBuilder | public static BindingDefinition unmarshalBindingDefinition(UnmarshallingContext ctx, String name, URL root) throws JiBXException(Code)(Java Doc) public static void unmarshalInclude(UnmarshallingContext ctx, BindingDefinition bdef, URL root, ArrayList nslist, HashSet paths) throws JiBXException(Code)(Java Doc) public static IMapping unmarshalMapping(UnmarshallingContext ctx, IContainer parent, ArrayList nss, boolean uord) throws JiBXException(Code)(Java Doc) public static IComponent unmarshalStructure(UnmarshallingContext ctx, IContainer contain, IContextObj cobj, boolean coll, boolean uord, boolean implic) throws JiBXException(Code)(Java Doc)
|
|
|