org.exolab.castor.builder
Interface BindingComponent
- All Known Implementing Classes:
- XMLBindingComponent
- public interface BindingComponent
This interface is the abstraction of any type of source that can interact
with the Source Code Generator. From the Source Code Generator point of view,
the source document used to generate Java source code is totally transparent
and is not exposed.
Specific implementation of that class will represent the source document
used. For instance when generating source code from an XML Schema, the source
generator will interact with an
XMLBindingComponent whereas when
generating source code from an UML model object model, the source generator
will interact with an UMLBindingComponent (This is obviously just an example,
no UML Object Model has been as of today integrated in Castor).
A binding component can be of three different types:
- MEMBER: this type of BindingComponent will represent a java class
member.
- INTERFACE: this type of BindingComponent will represent a java
interface.
- CLASS: this type of BindingComponent will represent a java class.
- Version:
- $Revision: 6766 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar
2005) $
- Author:
- Arnaud Blandin
|
Field Summary |
static short |
CLASS
A class binding component. |
static short |
ENUM_TYPE
An enum binding component. |
static short |
INTERFACE
An interface binding component. |
static short |
MEMBER
A member binding component. |
|
Method Summary |
boolean |
equals(java.lang.Object object)
Returns true if the given Object is equal to this instance of
BindingComponent. |
java.lang.String |
getCollectionType()
Returns the name of collection type such as 'arraylist' in which we will
store the different occurrences of the java member generated to represent
that BindingComponent. |
EnumBindingType |
getEnumBinding()
Returns the EnumBindingType instance for the active binding component. |
java.lang.String |
getExtends()
Returns the name of a super class for the current BindingComponent. |
java.lang.String[] |
getImplements()
Returns an array of the different interface names implemented by the
class that will represent the current BindingComponent. |
java.lang.String |
getJavaClassName()
Returns a valid Java Class Name corresponding to this BindingComponent.
|
java.lang.String |
getJavaMemberName()
Returns a valid Java Member Name corresponding to this BindingComponent.
|
java.lang.String |
getJavaPackage()
Returns the java package associated with this BindingComponent. |
XSType |
getJavaType()
Returns the XSType that corresponds to the Java type chosen to represent
this BindingComponent. |
int |
getLowerBound()
Returns the lower bound of the collection that is generated from this
BindingComponent. |
java.lang.String |
getQualifiedName()
Returns a fully qualified java class name. |
short |
getType()
Returns the type of this component binding. |
int |
getUpperBound()
Returns the upper bound of the collection that is generated from this
BindingComponent. |
java.lang.String |
getValidator()
Returns the fully qualified name of the Validator to use. |
java.lang.String |
getValue()
Returns the default value of the member generated from this binding
component. |
java.lang.String |
getXMLFieldHandler()
Returns the fully qualified name of the XMLFieldHandler to use. |
boolean |
hasBoundProperties()
Returns true if bound properties must be generated for the class that
will represent the current BindingComponent. |
boolean |
hasEquals()
Returns true if equal method must be generated for the class that will
represent the current BindingComponent. |
int |
hashCode()
Returns the hashCode value for this object. |
boolean |
isAbstract()
Returns true if the class generated from the current BindingComponent
will be abstract. |
boolean |
isFinal()
Returns true if the class generated from the current BindingComponent
will be final. |
boolean |
useWrapper()
Returns true if the member represented by that BindingComponent is to be
represented by an Object wrapper. |
INTERFACE
public static final short INTERFACE
- An interface binding component.
- See Also:
- Constant Field Values
CLASS
public static final short CLASS
- A class binding component.
- See Also:
- Constant Field Values
MEMBER
public static final short MEMBER
- A member binding component.
- See Also:
- Constant Field Values
ENUM_TYPE
public static final short ENUM_TYPE
- An enum binding component.
- See Also:
- Constant Field Values
equals
public boolean equals(java.lang.Object object)
- Returns true if the given Object is equal to this instance of
BindingComponent.
- Parameters:
object - the object to compare to this instance
- Returns:
- true if the given Object is equal to this instance of
BindingComponent.
- See Also:
Object.equals(java.lang.Object)
getCollectionType
public java.lang.String getCollectionType()
- Returns the name of collection type such as 'arraylist' in which we will
store the different occurrences of the java member generated to represent
that BindingComponent.
- Returns:
- a string that represents the collection type such as 'arraylist'
name in which we will store the different occurrences of the java
member generated to represent that BindingComponent.
getExtends
public java.lang.String getExtends()
- Returns the name of a super class for the current BindingComponent. Null
is returned if this BindingComponent is not meant to be mapped to a java
class.
- Returns:
- the name of a super class for the current BindingComponent. Null
is returned if this BindingComponent is not meant to be mapped to
a java class.
getImplements
public java.lang.String[] getImplements()
- Returns an array of the different interface names implemented by the
class that will represent the current BindingComponent. Null is returned
if this BindingComponent is not meant to be mapped to a java class.
- Returns:
- an array of the different interface names implemented by the
class that will represent the current BindingComponent. Null is
returned if this BindingComponent is not meant to be mapped to a
java class.
getJavaClassName
public java.lang.String getJavaClassName()
- Returns a valid Java Class Name corresponding to this BindingComponent.
This name is not qualified, this is only a local Java class name.
- Returns:
- a valid Java Class Name corresponding to this BindingComponent.
This name is not qualified, this is only a local Java class name.
- See Also:
getQualifiedName()
getJavaMemberName
public java.lang.String getJavaMemberName()
- Returns a valid Java Member Name corresponding to this BindingComponent.
This name is not qualified, this is only a local Java Member name.
- Returns:
- a valid Java Member Name corresponding to this BindingComponent.
This name is not qualified, this is only a local Java member
name.
- See Also:
getQualifiedName()
getJavaPackage
public java.lang.String getJavaPackage()
- Returns the java package associated with this BindingComponent.
- Returns:
- the java package associated with this BindingComponent.
getJavaType
public XSType getJavaType()
- Returns the XSType that corresponds to the Java type chosen to represent
this BindingComponent. An XSType is an abstraction of a Java type used in
the Source Generator. It wraps a JType as well as the necessary methods
to convert to/from String.
- Returns:
- an XSType that corresponds to the Java type chosen to represent
this BindingComponent.
getLowerBound
public int getLowerBound()
- Returns the lower bound of the collection that is generated from this
BindingComponent. The lower bound is a positive integer.
- Returns:
- an int representing the lower bound of the collection generated
from this BindingComponent.
getQualifiedName
public java.lang.String getQualifiedName()
- Returns a fully qualified java class name. This name corresponds to the
class name that will be generated from this BindingComponent.
- Returns:
- a fully qualified java class name. This name corresponds to the
class name corresponding to this BindingComponent.
getType
public short getType()
- Returns the type of this component binding. A component binding can be of
three different types:
- Interface: it represents the binding to a java interface.
- Class: it represents the binding to a java class.
- Member: it represents the binding to a java class member.
-1 is returned if the component binding is null.
- Returns:
- the type of this component binding.
getUpperBound
public int getUpperBound()
- Returns the upper bound of the collection that is generated from this
BindingComponent. The upper bound is a positive integer. -1 is returned
to indicate that the upper bound is unbounded.
- Returns:
- an int representing the lower bound of the collection generated
from this BindingComponent. -1 is returned to indicate that the
upper bound is uinbounded.
getValue
public java.lang.String getValue()
- Returns the default value of the member generated from this binding
component. The value is returned as its string representation.
- Returns:
- a string representation of default value for the member generated
from this binding component.
getValidator
public java.lang.String getValidator()
- Returns the fully qualified name of the Validator to use.
- Returns:
- the fully qualified name of the Validator to use.
getEnumBinding
public EnumBindingType getEnumBinding()
- Returns the EnumBindingType instance for the active binding component.
- Returns:
- The EnumBindingType instance
getXMLFieldHandler
public java.lang.String getXMLFieldHandler()
- Returns the fully qualified name of the XMLFieldHandler to use. This
handler will be used when generating ClassDescriptors meant to be used in
the marshalling framework.
- Returns:
- the fully qualified name of the XMLFieldHandler to use.
hasBoundProperties
public boolean hasBoundProperties()
- Returns true if bound properties must be generated for the class that
will represent the current BindingComponent.
- Returns:
- true if bound properties must be generated for the class the
class that will represent the current BindingComponent.
hasEquals
public boolean hasEquals()
- Returns true if equal method must be generated for the class that will
represent the current BindingComponent.
- Returns:
- true if equal method must be generated for the class the class
that will represent the current BindingComponent.
hashCode
public int hashCode()
- Returns the hashCode value for this object.
- Returns:
- the hashcode value for this object.
- See Also:
Object.hashCode()
isAbstract
public boolean isAbstract()
- Returns true if the class generated from the current BindingComponent
will be abstract.
- Returns:
- true if the class generated from the current BindingComponent
will be abstract.
isFinal
public boolean isFinal()
- Returns true if the class generated from the current BindingComponent
will be final.
- Returns:
- true if the class generated from the current BindingComponent
will be final.
useWrapper
public boolean useWrapper()
- Returns true if the member represented by that BindingComponent is to be
represented by an Object wrapper. For instance an int will be represented
by a java Integer if the property is set to true.
- Returns:
- true if the member represented by that BindingComponent is to be
represented by an Object wrapper.
Intalio Inc. (C) 1999-2007. All rights reserved http://www.intalio.com