Class CBuiltinLeafInfo
- java.lang.Object
-
- com.sun.tools.xjc.model.CBuiltinLeafInfo
-
- All Implemented Interfaces:
CCustomizable,CNonElement,CTypeInfo,TypeUse,com.sun.xml.bind.v2.model.annotation.Locatable,com.sun.xml.bind.v2.model.core.BuiltinLeafInfo<NType,NClass>,com.sun.xml.bind.v2.model.core.LeafInfo<NType,NClass>,com.sun.xml.bind.v2.model.core.MaybeElement<NType,NClass>,com.sun.xml.bind.v2.model.core.NonElement<NType,NClass>,com.sun.xml.bind.v2.model.core.TypeInfo<NType,NClass>,com.sun.xml.bind.v2.runtime.Location
public abstract class CBuiltinLeafInfo extends Object implements CNonElement, com.sun.xml.bind.v2.model.core.BuiltinLeafInfo<NType,NClass>, com.sun.xml.bind.v2.model.core.LeafInfo<NType,NClass>, com.sun.xml.bind.v2.runtime.Location
Encapsulates the default handling for leaf classes (which are bound to text in XML.) In particular this class knows how to convert the lexical value into the Java class according to this default rule.This represents the spec-defined default handling for the Java type (
getType().For those Java classes (such as
StringorBoolean) where the spec designates a specific default handling, there are constants in this class (such asSTRINGorBOOLEAN.)The generated type-safe enum classes are also a leaf class, and as such there are
CEnumLeafInfothat represents it asCBuiltinLeafInfo.This class represents the default handling, and therefore we can only have one instance per one
NType. Handling of other XML Schema types (such as xs:token) are represented as a generalTypeUseobjects.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static CBuiltinLeafInfoANYTYPEstatic CBuiltinLeafInfoBASE64_BYTE_ARRAYstatic CBuiltinLeafInfoBIG_DECIMALstatic CBuiltinLeafInfoBIG_INTEGERstatic CBuiltinLeafInfoBOOLEANstatic TypeUseBOOLEAN_ZERO_OR_ONEboolean restricted to 0 or 1.static CBuiltinLeafInfoBYTEstatic CBuiltinLeafInfoCALENDARstatic CBuiltinLeafInfoDATA_HANDLERstatic CBuiltinLeafInfoDOUBLEstatic CBuiltinLeafInfoDURATIONstatic CBuiltinLeafInfoFLOATstatic TypeUseHEXBIN_BYTE_ARRAYstatic TypeUseIDstatic TypeUseIDREFIDREF.static CBuiltinLeafInfoIMAGEstatic CBuiltinLeafInfoINTstatic Map<NType,CBuiltinLeafInfo>LEAVESAll built-in leaves.static CBuiltinLeafInfoLONGstatic TypeUseNORMALIZED_STRINGstatic CBuiltinLeafInfoQNAMEstatic CBuiltinLeafInfoSHORTstatic CBuiltinLeafInfoSTRINGstatic TypeUseSTRING_LISTFor all list of strings, such as NMTOKENS, ENTITIES.static TypeUseTOKENstatic CBuiltinLeafInfoXML_SOURCE
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.sun.xml.bind.v2.model.core.Element<NType,NClass>asElement()Deprecated.always return null at this level.booleancanBeReferencedByIDREF()Deprecated.why are you calling a method whose return value is always known?CAdaptergetAdapterUse()Deprecated.QNamegetElementName()Deprecated.always return null at this level.javax.activation.MimeTypegetExpectedMimeType()CBuiltinLeafInfonever has a default associated MIME type.CNonElementgetInfo()Deprecated.com.sun.xml.bind.v2.runtime.LocationgetLocation()LocatorgetLocator()Gets the source location in the schema from which this model component is created.XSComponentgetSchemaComponent()If this model object is built from XML Schema, this property returns a schema component from which the model is built.NTypegetType()A reference to the representation of the type.QNamegetTypeName()QName[]getTypeNames()Returns all the type names recognized by this bean info.com.sun.xml.bind.v2.model.annotation.LocatablegetUpstream()com.sun.xml.bind.v2.model.core.IDidUse()Whether the referenced type (individual item type in case of collection) is ID/IDREF.booleanisCollection()Deprecated.booleanisElement()Deprecated.always return false at this level.booleanisSimpleType()TypeUsemakeAdapted(Class<? extends javax.xml.bind.annotation.adapters.XmlAdapter> adapter, boolean copy)Creates aTypeUsethat represents an adapted use of thisCBuiltinLeafInfo.TypeUsemakeCollection()Creates aTypeUsethat represents a collection of thisCBuiltinLeafInfo.TypeUsemakeMimeTyped(javax.activation.MimeType mt)Creates aTypeUsethat represents a MIME-type assocaited version of thisCBuiltinLeafInfo.JTypetoType(Outline o, Aspect aspect)Gets the code model representation of this 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.CCustomizable
getCustomizations
-
Methods inherited from interface com.sun.tools.xjc.model.TypeUse
createConstant
-
-
-
-
Field Detail
-
LEAVES
public static final Map<NType,CBuiltinLeafInfo> LEAVES
All built-in leaves.
-
ANYTYPE
public static final CBuiltinLeafInfo ANYTYPE
-
STRING
public static final CBuiltinLeafInfo STRING
-
BOOLEAN
public static final CBuiltinLeafInfo BOOLEAN
-
INT
public static final CBuiltinLeafInfo INT
-
LONG
public static final CBuiltinLeafInfo LONG
-
BYTE
public static final CBuiltinLeafInfo BYTE
-
SHORT
public static final CBuiltinLeafInfo SHORT
-
FLOAT
public static final CBuiltinLeafInfo FLOAT
-
DOUBLE
public static final CBuiltinLeafInfo DOUBLE
-
QNAME
public static final CBuiltinLeafInfo QNAME
-
CALENDAR
public static final CBuiltinLeafInfo CALENDAR
-
DURATION
public static final CBuiltinLeafInfo DURATION
-
BIG_INTEGER
public static final CBuiltinLeafInfo BIG_INTEGER
-
BIG_DECIMAL
public static final CBuiltinLeafInfo BIG_DECIMAL
-
BASE64_BYTE_ARRAY
public static final CBuiltinLeafInfo BASE64_BYTE_ARRAY
-
DATA_HANDLER
public static final CBuiltinLeafInfo DATA_HANDLER
-
IMAGE
public static final CBuiltinLeafInfo IMAGE
-
XML_SOURCE
public static final CBuiltinLeafInfo XML_SOURCE
-
HEXBIN_BYTE_ARRAY
public static final TypeUse HEXBIN_BYTE_ARRAY
-
TOKEN
public static final TypeUse TOKEN
-
NORMALIZED_STRING
public static final TypeUse NORMALIZED_STRING
-
ID
public static final TypeUse ID
-
BOOLEAN_ZERO_OR_ONE
public static final TypeUse BOOLEAN_ZERO_OR_ONE
boolean restricted to 0 or 1.
-
IDREF
public static final TypeUse IDREF
IDREF. IDREF is has a whitespace normalization semantics of token, but we don't wantXmlJavaTypeAdapterandXmlIDREFto interact.
-
STRING_LIST
public static final TypeUse STRING_LIST
For all list of strings, such as NMTOKENS, ENTITIES.
-
-
Method Detail
-
toType
public JType toType(Outline o, Aspect aspect)
Gets the code model representation of this type.- Specified by:
toTypein interfaceCTypeInfo- See Also:
NType.toType(Outline, com.sun.tools.xjc.outline.Aspect)
-
isCollection
@Deprecated public final boolean isCollection()
Deprecated.SinceCBuiltinLeafInforepresents a default binding, it is never a collection.- Specified by:
isCollectionin interfaceCNonElement- Specified by:
isCollectionin interfaceTypeUse
-
getInfo
@Deprecated public CNonElement getInfo()
Deprecated.Guaranteed to return this.- Specified by:
getInfoin interfaceCNonElement- Specified by:
getInfoin interfaceTypeUse
-
idUse
public com.sun.xml.bind.v2.model.core.ID idUse()
Description copied from interface:TypeUseWhether 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.
-
getExpectedMimeType
public javax.activation.MimeType getExpectedMimeType()
CBuiltinLeafInfonever has a default associated MIME type.- Specified by:
getExpectedMimeTypein interfaceTypeUse
-
getAdapterUse
@Deprecated public final CAdapter getAdapterUse()
Deprecated.Description copied from interface:CNonElementGuaranteed to return null.- Specified by:
getAdapterUsein interfaceCNonElement- Specified by:
getAdapterUsein interfaceTypeUse
-
getLocator
public Locator getLocator()
Description copied from interface:CCustomizableGets the source location in the schema from which this model component is created.- Specified by:
getLocatorin interfaceCCustomizable- Returns:
- never null.
-
getSchemaComponent
public final XSComponent getSchemaComponent()
Description copied from interface:CCustomizableIf this model object is built from XML Schema, this property returns a schema component from which the model is built.- Specified by:
getSchemaComponentin interfaceCCustomizable- Returns:
- null if the model is built from sources other than XML Schema (such as DTD.)
-
makeCollection
public final TypeUse makeCollection()
Creates aTypeUsethat represents a collection of thisCBuiltinLeafInfo.
-
makeAdapted
public final TypeUse makeAdapted(Class<? extends javax.xml.bind.annotation.adapters.XmlAdapter> adapter, boolean copy)
Creates aTypeUsethat represents an adapted use of thisCBuiltinLeafInfo.
-
makeMimeTyped
public final TypeUse makeMimeTyped(javax.activation.MimeType mt)
Creates aTypeUsethat represents a MIME-type assocaited version of thisCBuiltinLeafInfo.
-
isElement
public final boolean isElement()
Deprecated.always return false at this level.
-
getElementName
public final QName getElementName()
Deprecated.always return null at this level.
-
asElement
public final com.sun.xml.bind.v2.model.core.Element<NType,NClass> asElement()
Deprecated.always return null at this level.
-
getType
public NType getType()
A reference to the representation of the type.
-
getTypeNames
public final QName[] getTypeNames()
Returns all the type names recognized by this bean info.- Returns:
- do not modify the returned array.
-
canBeReferencedByIDREF
public final boolean canBeReferencedByIDREF()
Deprecated.why are you calling a method whose return value is always known?Leaf-type cannot be referenced from IDREF.
-
getTypeName
public QName getTypeName()
-
getUpstream
public com.sun.xml.bind.v2.model.annotation.Locatable getUpstream()
- Specified by:
getUpstreamin interfacecom.sun.xml.bind.v2.model.annotation.Locatable
-
getLocation
public com.sun.xml.bind.v2.runtime.Location getLocation()
- Specified by:
getLocationin interfacecom.sun.xml.bind.v2.model.annotation.Locatable
-
-