com.sun.tools.xjc.model
Class AbstractCTypeInfoImpl

java.lang.Object
  extended by com.sun.tools.xjc.model.AbstractCTypeInfoImpl
All Implemented Interfaces:
CCustomizable, CTypeInfo, TypeUse, com.sun.xml.bind.v2.model.annotation.Locatable, com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>
Direct Known Subclasses:
CArrayInfo, CClassInfo, CElementInfo, CWildcardTypeInfo

abstract class AbstractCTypeInfoImpl
extends java.lang.Object
implements CTypeInfo

Partial implementation of CTypeInfo.

The inheritance of TypeUse by CTypeInfo isn't a normal inheritance (see CTypeInfo for more.) This class implments methods on TypeUse for CTypeInfo.


Constructor Summary
protected AbstractCTypeInfoImpl(Model model, com.sun.xml.xsom.XSComponent source, CCustomizations customizations)
           
 
Method Summary
 boolean canBeReferencedByIDREF()
          Deprecated. why are you calling an unimplemented method?
 com.sun.codemodel.JExpression createConstant(Outline outline, com.sun.xml.xsom.XmlString lexical)
          Creates a constant for the given lexical value.
 CAdapter getAdapterUse()
          If this type use is adapting the type, returns the adapter.
 CCustomizations getCustomizations()
          Gets the list of customizations attached to this model component.
 javax.activation.MimeType getExpectedMimeType()
          No default MimeType.
 CTypeInfo getInfo()
          Individual item type.
 com.sun.xml.bind.v2.runtime.Location getLocation()
           
 com.sun.xml.xsom.XSComponent getSchemaComponent()
          If this model object is built from XML Schema, this property returns a schema component from which the model is built.
 com.sun.xml.bind.v2.model.annotation.Locatable getUpstream()
           
 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.tools.xjc.model.CTypeInfo
toType
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.TypeInfo
getType
 
Methods inherited from interface com.sun.tools.xjc.model.CCustomizable
getLocator
 

Constructor Detail

AbstractCTypeInfoImpl

protected AbstractCTypeInfoImpl(Model model,
                                com.sun.xml.xsom.XSComponent source,
                                CCustomizations customizations)
Method Detail

isCollection

public final boolean isCollection()
Description copied from interface: TypeUse
If the use can hold multiple values of the specified type.

Specified by:
isCollection in interface TypeUse

getAdapterUse

public final CAdapter getAdapterUse()
Description copied from interface: TypeUse
If this type use is adapting the type, returns the adapter. Otherwise return null.

Specified by:
getAdapterUse in interface TypeUse

getInfo

public final CTypeInfo getInfo()
Description copied from interface: TypeUse
Individual item type.

Specified by:
getInfo in interface TypeUse

idUse

public final com.sun.xml.bind.v2.model.core.ID idUse()
Description copied from interface: TypeUse
Whether the referenced type (individual item type in case of collection) is ID/IDREF.

ID 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.

Specified by:
idUse in interface TypeUse

getSchemaComponent

public final com.sun.xml.xsom.XSComponent getSchemaComponent()
Description copied from interface: CCustomizable
If this model object is built from XML Schema, this property returns a schema component from which the model is built.

Specified by:
getSchemaComponent in interface CCustomizable
Returns:
null if the model is built from sources other than XML Schema (such as DTD.)

canBeReferencedByIDREF

public final boolean canBeReferencedByIDREF()
Deprecated. why are you calling an unimplemented method?

Specified by:
canBeReferencedByIDREF in interface com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>

getExpectedMimeType

public javax.activation.MimeType getExpectedMimeType()
No default MimeType.

Specified by:
getExpectedMimeType in interface TypeUse

getCustomizations

public CCustomizations getCustomizations()
Description copied from interface: CCustomizable
Gets the list of customizations attached to this model component.

Specified by:
getCustomizations in interface CCustomizable
Returns:
can be an empty list but never be null. The returned list is read-only. Do not modify.
See Also:
Plugin.getCustomizationURIs()

createConstant

public com.sun.codemodel.JExpression createConstant(Outline outline,
                                                    com.sun.xml.xsom.XmlString lexical)
Description copied from interface: TypeUse
Creates a constant for the given lexical value.

For 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.

Specified by:
createConstant in interface TypeUse
Returns:
null if the constant cannot be created for this TypeUse (such as when it's a collection)

getUpstream

public final com.sun.xml.bind.v2.model.annotation.Locatable getUpstream()
Specified by:
getUpstream in interface com.sun.xml.bind.v2.model.annotation.Locatable

getLocation

public final com.sun.xml.bind.v2.runtime.Location getLocation()
Specified by:
getLocation in interface com.sun.xml.bind.v2.model.annotation.Locatable