|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Binding
represents an arbitrary Java construct,
and provides a representation-independent means of showing
how a constraint (presumably from an XML Schema, DTD, Relax
schema, etc.) maps to Java. It provides a layer of representation
between the constraint representation and generated Java.
It also allows for uniformity in mapping. For example, the DTD
ELEMENT
and XML Schema element
constructs, while different, should both be mapped to the
same implementation of a Binding
in Zeus. In this
way, constraints that represent semantically equivalent
constructs result in identical sets of bindings.
DTDBinder
,
SchemaBinder
Method Summary | |
java.lang.String |
getJavaCollectionClass()
This will return the Java collection class to use for this binding, if it is a collection. |
java.lang.String |
getJavaImplementationPackage()
This will return the Java package name for this binding's implementation class. |
java.lang.String |
getJavaInterfacePackage()
This will return the Java package name for this binding's interface class. |
java.lang.String |
getJavaName()
This will return the Java name of the binding. |
java.lang.String |
getJavaType()
This will return the Java type associated with the binding. |
java.lang.String |
getJavaVariableName()
This will return the Java name that can be used for a variable name in generated code. |
java.lang.String |
getXMLName()
This will return the XML name of the binding. |
java.lang.String |
getXMLNamespaceURI()
The will return the XML namespace URI associated with the XML name of this binding. |
java.lang.String |
getXMLParentType()
This will return the XML local name associated with the XML type of this binding's XML parent. |
java.lang.String |
getXMLParentTypeNamespaceURI()
The will return the XML namespace URI associated with the XML type of this binding's XML parent. |
java.lang.String |
getXMLType()
This will return the XML local name associated with the XML type of this binding. |
java.lang.String |
getXMLTypeNamespaceURI()
The will return the XML namespace URI associated with the XML type of this binding. |
boolean |
isJavaSerializable()
This will indicate whether this binding is Java-serializable (indicated by a boolean value of "true"), or not (indicated by a
boolean value of "false"). |
boolean |
isXMLRootElement()
This indicates if this binding represents an XML element that is the root element of the document. |
void |
setIsJavaSerializable(boolean isJavaSerializable)
This will set whether this binding should be a Java-serializable class. |
void |
setIsXMLRootElement(boolean isXMLRootElement)
This sets whether this binding represents an XML element that is the root element of the document. |
void |
setJavaCollectionClass(java.lang.String javaCollectionClass)
This will set the Java collection class to use for this binding, if it is a collection. |
void |
setJavaImplementationPackage(java.lang.String javaImplementationPackage)
This will set the Java package for this class's implementation. |
void |
setJavaInterfacePackage(java.lang.String javaInterfacePackage)
This will set the Java package for this class's interface. |
void |
setJavaName(java.lang.String javaName)
The will set the name of the Java variable associated with this binding. |
void |
setJavaType(java.lang.String javaType)
This will set the Java type for this binding. |
void |
setJavaVariableName(java.lang.String javaVariableName)
This will set the Java name that can be used for a variable name in generated code. |
void |
setXMLName(java.lang.String xmlName)
This will set the XML name of the binding. |
void |
setXMLNamespaceURI(java.lang.String xmlNameURI)
The will set the XML namespace URI associated with the XML name of this binding. |
void |
setXMLParentType(java.lang.String xmlParentType)
This will set the XML local name associated with the XML type of this binding's XML parent. |
void |
setXMLParentTypeNamespaceURI(java.lang.String xmlParentTypeNamespaceURI)
This will set the XML namespace URI associated with the XML type of this binding's XML parent. |
void |
setXMLType(java.lang.String xmlType)
This will set the XML local name associated with the XML type of this binding. |
void |
setXMLTypeNamespaceURI(java.lang.String xmlTypeNamespaceURI)
This will set the XML namespace URI associated with the XML type of this binding. |
Method Detail |
public java.lang.String getXMLName()
This will return the XML name of the binding. This should be the actual XML name of the binding as would be seen in an XML document.
String
- the XML name of the binding.public void setXMLName(java.lang.String xmlName)
This will set the XML name of the binding.
xmlName
- the XML name of the binding.public java.lang.String getXMLNamespaceURI()
The will return the XML namespace URI associated with the XML name of this binding. A value of the empty string indicates that there is no URI associated with the XML name of this binding.
String
- the XML namespace URI associated with the
XML name of this binding, or an empty string if no namespace URI.public void setXMLNamespaceURI(java.lang.String xmlNameURI)
The will set the XML namespace URI associated with the XML name of this binding. A value of the empty string indicates that there is no URI associated with the XML name of this binding.
xmlNameURI
- the XML namespace URIpublic java.lang.String getXMLType()
This will return the XML local name associated with the XML type of this binding. When using a DTD, the XML type is the same as the XML name. However, when using an XML Schema, the type may be different from the name.
String
- the XML local name of the XML type of this
binding.public void setXMLType(java.lang.String xmlType)
This will set the XML local name associated with the XML type of this binding.
xmlType
- the XML type.public java.lang.String getXMLTypeNamespaceURI()
The will return the XML namespace URI associated with the XML type of this binding. A value of the empty string indicates that there is no URI associated with the XML type of this binding.
While this is not
useful in DTD binding, it allows types like xsd:string
to
be distinguished from something like myPrefix:string
,
which a user might define.
String
- the XML namespace URI associated with the
XML type of this binding.public void setXMLTypeNamespaceURI(java.lang.String xmlTypeNamespaceURI)
This will set the XML namespace URI associated with the XML type of this binding. A value of the empty string indicates that there is no URI associated with the XML type of this binding.
xmlTypeNamespaceURI
- the XML namespace URI.public java.lang.String getXMLParentType()
This will return the XML local name associated with the XML type of this binding's XML parent. When using a DTD, the XML type is the same as the XML name. However, when using an XML Schema, the type may be different from the name.
If there is no parent XML type, such as for the root element of a
document, this value is null
.
String
- the XML local name of the XML type of this
binding's parent.public void setXMLParentType(java.lang.String xmlParentType)
This will set the XML local name associated with the XML type of this binding's XML parent.
xmlParentType
- the XML type for this binding's parent.public java.lang.String getXMLParentTypeNamespaceURI()
The will return the XML namespace URI associated with the XML type of this binding's XML parent. A value of the empty string indicates that there is no URI associated with the XML type of this binding's parent.
While this is not
useful in DTD binding, it allows types like xsd:string
to
be distinguished from something like myPrefix:string
,
which a user might define.
String
- the XML namespace URI associated with the
XML type of this binding's parent.public void setXMLParentTypeNamespaceURI(java.lang.String xmlParentTypeNamespaceURI)
This will set the XML namespace URI associated with the XML type of this binding's XML parent. A value of the empty string indicates that there is no URI associated with the XML type of this binding's parent.
xmlParentTypeNamespaceURI
- the XML namespace URI of the
parent type.public void setIsXMLRootElement(boolean isXMLRootElement)
This sets whether this binding represents an XML element that is the root element of the document.
isXMLRootElement
- whether this is the root element.public boolean isXMLRootElement()
This indicates if this binding represents an XML element that is the root element of the document.
boolean
- whether this is the root element.public java.lang.String getJavaName()
This will return the Java name of the binding. This should
be the valid Java name of the binding, which is most
often a variable name. This is the string used to build the methods
setXXX()
and getXXX()
. Note that this is
not necessarily the variable name used by the generators, but they
will provide the setXXX()
and getXXX()
based on this name.
String
- the Java name of the binding.public void setJavaName(java.lang.String javaName)
The will set the name of the Java variable associated with this binding.
javaName
- the new variable name.public java.lang.String getJavaVariableName()
This will return the Java name that can be used for a variable name in generated code. It is guaranteed to be a legal Java identifier.
To illustrate the difference between the Java name and its variable name, consider this simple example:
With the above DTD the XML name is "default". However, "default"
is a Java keyword, but setDefault()
and
getDefault()
are not illegal. So for a typical name
binding, the Java name would be "default" and the variable name
would (could) be "safeDefault". The generated interface would still
contain setDefault()
and getDefault()
.
Note that it is not necessary for the variable name to always (or even often) be different from the normal Java name.
String
- the Java variable name.public void setJavaVariableName(java.lang.String javaVariableName)
This will set the Java name that can be used for a variable name in generated code. This must be a legal Java identifier, and the first character must not be an upper case letter.
javaVariableName
- the name to use for the Java member variable.public java.lang.String getJavaInterfacePackage()
This will return the Java package name for this binding's interface class.
String
- the Java interface package associated with
the binding's Java type.public void setJavaInterfacePackage(java.lang.String javaInterfacePackage)
This will set the Java package for this class's interface.
javaInterfacePackage
- the name of the interface package for this
binding.public java.lang.String getJavaImplementationPackage()
This will return the Java package name for this binding's implementation class.
String
- the Java implementation package associated
with the binding's Java type.public void setJavaImplementationPackage(java.lang.String javaImplementationPackage)
This will set the Java package for this class's implementation.
javaImplementationPackage
- the name of the implementation package
for this binding.public java.lang.String getJavaType()
This will return the Java type associated with the binding. This is not a fully qualified name for the type. To get the fully qualified name for the type prepend the value returned from getJavaPackage() to the value returned by this method (with a "." inserted in between if the package is not the empty string).
String
- the Java type of the binding.public void setJavaType(java.lang.String javaType)
This will set the Java type for this binding.
javaType
- the Java type for this binding.public void setJavaCollectionClass(java.lang.String javaCollectionClass) throws InvalidCollectionTypeException
This will set the Java collection class to use for this binding,
if it is a collection. This will be a fully-qualified Java class,
such as java.util.List
.
javaCollectionClass
- the collection class for this binding.InvalidCollectionTypeException
- - when the supplied
collection class is not a valid collection type.public java.lang.String getJavaCollectionClass()
This will return the Java collection class to use for this binding,
if it is a collection. This will be a fully qualified Java class,
such as java.util.List
.
String
- the Java collection class for this binding.public void setIsJavaSerializable(boolean isJavaSerializable)
This will set whether this binding should be a Java-serializable class.
isJavaSerializable
- whether this binding should be Java
serializable (true) or not (false).public boolean isJavaSerializable()
This will indicate whether this binding is Java-serializable (indicated
by a boolean
value of "true"), or not (indicated by a
boolean
value of "false").
boolean
- whether this binding is Java-serializable.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |