|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.tools.xjc.model.TypeUseImpl
final class TypeUseImpl
General-purpose TypeUse implementation.
| Constructor Summary | |
|---|---|
TypeUseImpl(CNonElement itemType,
boolean collection,
com.sun.xml.bind.v2.model.core.ID id,
javax.activation.MimeType expectedMimeType,
CAdapter adapter)
|
|
| Method Summary | |
|---|---|
com.sun.codemodel.JExpression |
createConstant(Outline outline,
com.sun.xml.xsom.XmlString lexical)
Creates a constant for the given lexical value. |
boolean |
equals(java.lang.Object o)
|
CAdapter |
getAdapterUse()
If this type use is adapting the type, returns the adapter. |
javax.activation.MimeType |
getExpectedMimeType()
A TypeUse can have an associated MIME type. |
CNonElement |
getInfo()
Individual item type. |
int |
hashCode()
|
com.sun.xml.bind.v2.model.core.ID |
idUse()
Whether the referenced type (individual item type in case of collection) is ID/IDREF. |
boolean |
isCollection()
If the use can hold multiple values of the specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeUseImpl(CNonElement itemType,
boolean collection,
com.sun.xml.bind.v2.model.core.ID id,
javax.activation.MimeType expectedMimeType,
CAdapter adapter)
| Method Detail |
|---|
public boolean isCollection()
TypeUse
isCollection in interface TypeUsepublic CNonElement getInfo()
TypeUse
getInfo in interface TypeUsepublic CAdapter getAdapterUse()
TypeUse
getAdapterUse in interface TypeUsepublic com.sun.xml.bind.v2.model.core.ID idUse()
TypeUseID is a property of a relationship. When a bean Foo has an ID property called 'bar' whose type is String, Foo isn't an ID, String isn't an ID, but this relationship is an ID (in the sense that Foo uses this String as an ID.)
The same thing can be said with IDREF. When Foo refers to Bar by means of IDREF, neither Foo nor Bar is IDREF.
That's why we have this method in TypeUse.
idUse in interface TypeUsepublic javax.activation.MimeType getExpectedMimeType()
TypeUseTypeUse can have an associated MIME type.
getExpectedMimeType in interface TypeUsepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
public com.sun.codemodel.JExpression createConstant(Outline outline,
com.sun.xml.xsom.XmlString lexical)
TypeUseFor example, to create a constant 1 for xs:int, you'd do:
CBuiltinLeafInfo.INT.createConstant( codeModel, "1", null );
This method is invoked at the backend as a part of the code generation process.
createConstant in interface TypeUseTypeUse
(such as when it's a collection)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||