Top Description Fields Constructors Methods
com.sun.tools.xjc.model

public final Class CTypeRef

extends Object
implements TypeRef<NType, NClass>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.core.v2.model.core.TypeRef, org.glassfish.jaxb.core.v2.model.core.NonElementRef
Imports
javax.xml.XMLConstants, jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter, javax.xml.namespace.QName, com.sun.tools.xjc.model.nav.NClass, .NType, com.sun.tools.xjc.reader.xmlschema.BGMBuilder, org.glassfish.jaxb.core.v2.model.core.PropertyInfo, .TypeRef, org.glassfish.jaxb.core.v2.runtime.RuntimeUtil, com.sun.xml.xsom.XSType, .XmlString, .XSElementDecl, com.sun.istack.Nullable

TypeRef for XJC.

Todo

do we need the source schema component support here?

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
public final XmlString
private final QName
private final boolean
private final CNonElement
type

In-memory type.

pack-priv final QName
typeName

XML Schema type name of type, if available.

Constructor Summary

AccessConstructor and Description
public
public
CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue)

Method Summary

Modifier and TypeMethod and Description
public String
getDefaultValue()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.getDefaultValue.

Inside XJC, use defaultValue that has context information.

public static QName
public PropertyInfo<NType, NClass>
getSource()

Implements org.glassfish.jaxb.core.v2.model.core.NonElementRef.getSource.

Gets the property which is the source of this reference.

public QName
getTagName()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.getTagName.

The associated element name.

public CNonElement
public QName
public boolean
public boolean
isNillable()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.isNillable.

Returns true if this element is nillable.

private static QName

Returns:

simpleTypeName or null
resolveSimpleTypeName
(XSType
given type
declType
)

Recursively search for type name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultValueback to summary
public final XmlString defaultValue
elementNameback to summary
private final QName elementName
nillableback to summary
private final boolean nillable
typeback to summary
private final CNonElement type

In-memory type. This is the type used when

Annotations
@XmlJavaTypeAdapter:ToStringAdapter
typeNameback to summary
pack-priv final QName typeName

XML Schema type name of type, if available.

Annotations
@Nullable

Constructor Detail

CTypeRefback to summary
public CTypeRef(CNonElement type, XSElementDecl decl)
CTypeRefback to summary
public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue)

Method Detail

getDefaultValueback to summary
public String getDefaultValue()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.getDefaultValue.

Inside XJC, use defaultValue that has context information. This method is to override the one defined in the runtime model.

Annotations
@Override
See Also
defaultValue
getSimpleTypeNameback to summary
public static QName getSimpleTypeName(XSElementDecl decl)
getSourceback to summary
public PropertyInfo<NType, NClass> getSource()

Implements org.glassfish.jaxb.core.v2.model.core.NonElementRef.getSource.

Doc from org.glassfish.jaxb.core.v2.model.core.NonElementRef.getSource.

Gets the property which is the source of this reference.

Annotations
@Override
getTagNameback to summary
public QName getTagName()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.getTagName.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeRef.getTagName.

The associated element name.

Annotations
@Override
getTargetback to summary
public CNonElement getTarget()

Implements org.glassfish.jaxb.core.v2.model.core.NonElementRef.getTarget.

Doc from org.glassfish.jaxb.core.v2.model.core.NonElementRef.getTarget.

Target of the reference.

Annotations
@Override
getTypeNameback to summary
public QName getTypeName()
isLeafback to summary
public boolean isLeaf()
isNillableback to summary
public boolean isNillable()

Implements org.glassfish.jaxb.core.v2.model.core.TypeRef.isNillable.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeRef.isNillable.

Returns true if this element is nillable.

Annotations
@Override
resolveSimpleTypeNameback to summary
private static QName resolveSimpleTypeName(XSType declType)

Recursively search for type name. This is needed to find correct type for refs like:

<xs:simpleType name="parent">
  <xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType name="child">
  <xs:restriction base="parent"/>
</xs:simpleType>

<xs:element name="testField" type="child"/>
Parameters
declType:XSType

given type

Returns:QName

simpleTypeName or null