|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jibx.binding.def.BindingDefinition
public class BindingDefinition
Binding definition. This is the root of the object graph for a binding.
| Field Summary | |
|---|---|
static int |
BASE_USER_NAMESPACE
First namespace index available for user definitions. |
static String |
CURRENT_VERSION_NAME
Current distribution file name. |
protected int |
m_accessLevel
Access level for default mappings. |
protected int |
m_autoLink
Auto-link style for default mappings. |
protected IContainer |
m_container
Containing binding component. |
protected int |
m_nameStyle
Style used for generating element or attribute names. |
protected String |
m_stripPrefix
Prefix text to be stripped from names. |
protected String |
m_stripSuffix
Suffix text to be stripped from names. |
protected int |
m_styleDefault
Default style for value expression. |
| Constructor Summary | |
|---|---|
BindingDefinition(String name,
boolean ibind,
boolean obind,
String tpack,
boolean glob,
boolean forward,
boolean source,
boolean force,
boolean add,
boolean trim,
int major,
int minor)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addClassList(ClassFile[] adds,
ClassFile[] keeps)
Add the list of classes used by the binding compiler to the binding factory. |
void |
addMappingName(String name)
Add mapping name to binding. |
int[] |
addPrecompiledBinding(IBindingFactory factory,
int major,
int minor)
Add a precompiled binding reference to this binding. |
void |
generateCode(boolean verbose)
Generate code. |
void |
generateCode(boolean verbose1,
boolean verbose2)
Generate code. |
static BindingDefinition |
getBinding(int index)
Get indexed binding. |
BindingDefinition |
getBindingRoot()
Get root of binding definition. |
BoundClass |
getBoundClass()
Get class linked to binding element. |
String |
getDefaultPackage()
Get default package used for code generation. |
File |
getDefaultRoot()
Get root directory for default code generation package. |
DefinitionContext |
getDefinitionContext()
Get definition context for binding element. |
String |
getFactoryName()
Get the fully-qualified name of the binding factory class for this binding. |
int |
getIdClassIndex(String name)
Get index for ID'ed class from binding. |
int |
getIndex()
Get index number of binding. |
String |
getMarshallerUnmarshallerName(String clas)
Get marshaller/unmarshaller name in binding. |
int |
getNamespaceUriIndex(String uri,
String prefix)
Get index for namespace URI in binding. |
String |
getPrefix()
Get prefix for method or class generation. |
String |
getPrefix(String uri)
Get the prefix assigned for a namespace. |
int |
getStyleDefault()
Get default style for value expression. |
boolean |
hasNamespaces()
|
static void |
indent(int depth)
|
boolean |
isAddConstructors()
Check if default constructor generation is enabled. |
boolean |
isContentOrdered()
Check if content children are ordered. |
boolean |
isForwards()
Check if forward ids are supported by unmarshalling binding. |
boolean |
isIdGlobal()
Check if global ids are used by binding. |
boolean |
isInput()
Check if binding is defined for unmarshalling. |
boolean |
isOutput()
Check if binding is defined for marshalling. |
boolean |
isTrackSource()
Check if source tracking is supported by unmarshalling binding. |
void |
print()
|
static void |
reset()
Discard cached information and reset in preparation for a new binding run. |
void |
setFactoryLocation(String tpack,
File root)
Set location for binding factory class generation. |
boolean |
setIdChild(IComponent child)
Set ID property. |
void |
setMarshallerUnmarshallerClasses(String name,
String mclas,
String uclas)
Set marshaller and unmarshaller class names. |
void |
setSchemaInstanceUsed()
Set flag for schema instance namespace used in binding. |
void |
unmarshal(UnmarshallingContext ctx)
Unmarshal common container attributes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BASE_USER_NAMESPACE
public static final String CURRENT_VERSION_NAME
protected IContainer m_container
protected int m_styleDefault
protected int m_autoLink
protected int m_accessLevel
protected String m_stripPrefix
protected String m_stripSuffix
protected int m_nameStyle
| Constructor Detail |
|---|
public BindingDefinition(String name,
boolean ibind,
boolean obind,
String tpack,
boolean glob,
boolean forward,
boolean source,
boolean force,
boolean add,
boolean trim,
int major,
int minor)
throws JiBXException
name - binding nameibind - input binding flagobind - output binding flagtpack - target packageglob - global IDs flagforward - support forward referenced IDs flagsource - add source tracking for unmarshalled objects flagforce - create marshaller/unmarshaller classes for top-level
non-base mappingsadd - add default constructors where necessary flagtrim - trim whitespace from simple values before conversion flagmajor - major version numberminor - minor version number
JiBXException - if error in transformation| Method Detail |
|---|
public BoundClass getBoundClass()
IContainer interface, just returns
null in this case.
public int getStyleDefault()
IContainer interface.
getStyleDefault in interface IContainerpublic boolean setIdChild(IComponent child)
child - child defining the ID property
falsepublic String getDefaultPackage()
public File getDefaultRoot()
public void setFactoryLocation(String tpack,
File root)
tpack - target package for generated context factoryroot - target root for generated context factorypublic int getIndex()
public boolean isInput()
true if defined, false if notpublic boolean isOutput()
true if defined, false if notpublic boolean isIdGlobal()
true if defined, false if notpublic boolean isForwards()
true if supported, false if notpublic boolean isTrackSource()
true if defined, false if notpublic boolean isAddConstructors()
true if default constructor generation enabled,
false if notpublic String getPrefix()
public void addMappingName(String name)
getMarshallerUnmarshallerName(java.lang.String)
method.
name - mapping name (type name if given, otherwise the fully
qualified mapped class name)public String getMarshallerUnmarshallerName(String clas)
setMarshallerUnmarshallerClasses(java.lang.String, java.lang.String, java.lang.String) method must be used to set
the actual class names.
clas - fully qualified name of class handled by
marshaller/unmarshaller
public void setMarshallerUnmarshallerClasses(String name,
String mclas,
String uclas)
name - assigned marshaller/unmarshaller namemclas - fully qualified name of marshaller classuclas - fully qualified name of unmarshaller classpublic int getIdClassIndex(String name)
0.
name - fully qualified name of ID'ed class
public int getNamespaceUriIndex(String uri,
String prefix)
0.
uri - namespace URI to be included in bindingprefix - prefix used with namespace
public void setSchemaInstanceUsed()
public int[] addPrecompiledBinding(IBindingFactory factory,
int major,
int minor)
factory - actual binding factory for precompiled bindingmajor - required major version numberminor - required minor version number
null if none)public String getPrefix(String uri)
fixPrefixes() method may
change the initial prefixes (if any) in order to avoid conflicts.
uri - namespace URI
public String getFactoryName()
public void generateCode(boolean verbose1,
boolean verbose2)
throws JiBXException
verbose1 - flag for verbose output from first passverbose2 - flag for verbose output from second pass
JiBXException - if error in code generation
public void generateCode(boolean verbose)
throws JiBXException
false for the second-pass
verbose flag. See generateCode(boolean, boolean) for details of
processing.
verbose - flag for verbose output from first pass
JiBXException - if error in code generation
public void addClassList(ClassFile[] adds,
ClassFile[] keeps)
adds - classes added by bindingkeeps - classes used but kept unchanged by bindingpublic static BindingDefinition getBinding(int index)
index - number of binding to be returned
public static void reset()
public boolean isContentOrdered()
IContainer
isContentOrdered in interface IContainertrue if ordered, false if notpublic boolean hasNamespaces()
public BindingDefinition getBindingRoot()
IContainer
getBindingRoot in interface IContainerpublic DefinitionContext getDefinitionContext()
IContainer
getDefinitionContext in interface IContainerpublic static void indent(int depth)
public void print()
public void unmarshal(UnmarshallingContext ctx)
throws JiBXException
ctx - unmarshalling context information
JiBXException - if error in unmarshalling
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||