public final class CClassInfo extends Object implements ClassInfo<NType,NClass>, CClassInfoParent, CClass, NClass
ClassInfo
representation.
Schema parsers build these objects.
Type | Property and Description |
---|---|
boolean |
hasValue
Returns true if this class or its ancestor has
XmlValue
property. |
CClassInfoParent.Package, CClassInfoParent.Visitor<T>
Modifier and Type | Field and Description |
---|---|
String |
javadoc
TODO: revisit this design.
|
Model |
model
The
Model object to which this bean belongs. |
String |
shortName
short name.
|
ANYTYPE_NAME
Constructor and Description |
---|
CClassInfo(Model model,
CClassInfoParent p,
String shortName,
Locator location,
QName typeName,
QName elementName,
com.sun.xml.xsom.XSComponent source,
CCustomizations customizations) |
CClassInfo(Model model,
JCodeModel cm,
String fullName,
Locator location,
QName typeName,
QName elementName,
com.sun.xml.xsom.XSComponent source,
CCustomizations customizations) |
CClassInfo(Model model,
JPackage pkg,
String shortName,
Locator location,
QName typeName,
QName elementName,
com.sun.xml.xsom.XSComponent source,
CCustomizations customizations) |
Modifier and Type | Method and Description |
---|---|
void |
_implements(JClass c) |
<T> T |
accept(CClassInfoParent.Visitor<T> visitor) |
void |
addConstructor(String... fieldNames)
Creates a new constructor declaration and adds it.
|
void |
addProperty(CPropertyInfo prop)
Adds a new property.
|
Element<NType,NClass> |
asElement()
|
boolean |
canBeReferencedByIDREF()
Deprecated.
why are you calling an unimplemented method?
|
JExpression |
createConstant(Outline outline,
com.sun.xml.xsom.XmlString lexical) |
boolean |
declaresAttributeWildcard()
Returns true if a new attribute wildcard property needs to be
declared on this class.
|
String |
fullName()
Returns the FQCN of this bean.
|
CAdapter |
getAdapterUse() |
CClassInfo |
getBaseClass()
This inherited version returns null if this class extends from
CClassRef . |
NClass |
getClazz()
Gets the declaration this object is wrapping.
|
Collection<? extends Constructor> |
getConstructors()
list all constructor declarations.
|
CCustomizations |
getCustomizations()
Gets the list of customizations attached to this model component.
|
QName |
getElementName()
Gets the element name of the class, if the class is bound
to an element.
|
MimeType |
getExpectedMimeType()
No default
MimeType . |
CNonElement |
getInfo()
Deprecated.
|
Location |
getLocation()
Gets the location object that this object points to.
|
Locator |
getLocator()
Gets the source location in the schema from which this model component is created.
|
String |
getName()
Gets the fully-qualified name of the class.
|
JPackage |
getOwnerPackage()
Gets the nearest
JPackage . |
List<CPropertyInfo> |
getProperties()
Returns a mutable list.
|
CPropertyInfo |
getProperty(String name)
Gets a propery by name.
|
CClassRef |
getRefBaseClass() |
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.
|
CClassInfo |
getScope()
If non-null, this element is only active inside the given scope.
|
String |
getSqueezedName()
Returns the "squeezed name" of this bean token.
|
CClassInfo |
getSubstitutionHead()
If this element can substitute another element, return that element.
|
NClass |
getType()
Gets the underlying Java type that object represents.
|
QName |
getTypeName()
Gets the primary XML type ANYTYPE_NAME of the class.
|
Locatable |
getUpstream()
Gets the upstream
Location information. |
String |
getUserSpecifiedImplClass() |
boolean |
hasAttributeWildcard()
Returns true if this bean class has an attribute wildcard.
|
void |
hasAttributeWildcard(boolean hasAttributeWildcard) |
boolean |
hasProperties()
If the class has properties, return true.
|
boolean |
hasSubClasses()
True if there's a known sub-type of this class in
TypeInfoSet . |
boolean |
hasValueProperty()
Returns true if this class or its ancestor has
XmlValue
property. |
ID |
idUse() |
boolean |
inheritsAttributeWildcard()
Returns true if this class inherits a wildcard attribute property
from its ancestor classes.
|
boolean |
isAbstract()
Returns true iff this element is an abstract element.
|
boolean |
isBoxedType()
Returns true iff this type represents a class that has a unboxed form.
|
boolean |
isCollection() |
boolean |
isElement()
If the class is bound to an element, return true.
|
boolean |
isFinal()
Deprecated.
if you are calling this method directly, you must be doing something wrong.
|
boolean |
isOrdered()
Returns true if the properties of this class is ordered in XML.
|
boolean |
isSimpleType()
Returns true if this
NonElement maps to text in XML,
without any attribute nor child elements. |
Iterator<CClassInfo> |
listSubclasses()
Enumerates all the sub-classes of this class.
|
CClassInfoParent |
parent() |
void |
setAbstract()
Marks this element as an abstract element.
|
void |
setBaseClass(CClass base)
This method accepts both
CClassInfo (which means the base class
is also generated), or CClassRef (which means the base class is
already generated and simply referenced.)
The latter is treated somewhat special --- from the rest of the model
this external base class is invisible. |
void |
setOrdered(boolean value) |
void |
setUserSpecifiedImplClass(String implClass) |
String |
toString() |
JClass |
toType(Outline o,
Aspect aspect)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isAbstract
getAdapterUse, isCollection
createConstant, getExpectedMimeType, idUse
isAbstract, setAbstract
getCustomizations, getLocator, getSchemaComponent
canBeReferencedByIDREF
getLocation, getUpstream
isAbstract
public boolean hasValueProperty
hasValueProperty
in interface ClassInfo<NType,NClass>
public String javadoc
public final String shortName
public CClassInfo(Model model, JPackage pkg, String shortName, Locator location, QName typeName, QName elementName, com.sun.xml.xsom.XSComponent source, CCustomizations customizations)
public CClassInfo(Model model, CClassInfoParent p, String shortName, Locator location, QName typeName, QName elementName, com.sun.xml.xsom.XSComponent source, CCustomizations customizations)
public CClassInfo(Model model, JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, com.sun.xml.xsom.XSComponent source, CCustomizations customizations)
public boolean hasAttributeWildcard()
ClassInfo
This is true if the class declares an attribute wildcard, or it is inherited from its super classes.
hasAttributeWildcard
in interface ClassInfo<NType,NClass>
ClassInfo.inheritsAttributeWildcard()
public void hasAttributeWildcard(boolean hasAttributeWildcard)
public boolean hasSubClasses()
ClassInfo
TypeInfoSet
.hasSubClasses
in interface ClassInfo<NType,NClass>
public boolean declaresAttributeWildcard()
declaresAttributeWildcard
in interface ClassInfo<NType,NClass>
public boolean inheritsAttributeWildcard()
inheritsAttributeWildcard
in interface ClassInfo<NType,NClass>
public NClass getClazz()
ClassInfo
public CClassInfo getScope()
Element
public String getName()
ClassInfo
public String getSqueezedName()
The squeezed name of a bean is the concatenation of the names of its outer classes and itself.
Thus if the bean is "org.acme.foo.Bean", then the squeezed name is "Bean", if the bean is "org.acme.foo.Outer1.Outer2.Bean", then "Outer1Outer2Bean".
This is used by the code generator
public List<CPropertyInfo> getProperties()
getProperties
in interface ClassInfo<NType,NClass>
public boolean hasValueProperty()
ClassInfo
XmlValue
property.hasValueProperty
in interface ClassInfo<NType,NClass>
public CPropertyInfo getProperty(String name)
getProperty
in interface ClassInfo<NType,NClass>
PropertyInfo.getName()
public boolean hasProperties()
ClassInfo
ClassInfo.getProperties()
is not empty.hasProperties
in interface ClassInfo<NType,NClass>
public boolean isElement()
MaybeElement
Note that when this is true, the class is bound to both an element and a type.
isElement
in interface MaybeElement<NType,NClass>
@Deprecated public CNonElement getInfo()
getInfo
in interface CNonElement
getInfo
in interface TypeUse
public Element<NType,NClass> asElement()
MaybeElement
asElement
in interface MaybeElement<NType,NClass>
MaybeElement.isElement()
==false, non-null if MaybeElement.isElement()
==true.public boolean isOrdered()
ClassInfo
In RELAX NG context, ordered properties mean <group>
and
unordered properties mean <interleave>
.
public boolean isFinal()
ClassInfo
public void setOrdered(boolean value)
public QName getElementName()
MaybeElement
getElementName
in interface Element<NType,NClass>
getElementName
in interface MaybeElement<NType,NClass>
MaybeElement.isElement()
.public QName getTypeName()
NonElement
A Java type can be mapped to multiple XML types, but one of them is considered "primary" and used when we generate a schema.
getTypeName
in interface NonElement<NType,NClass>
public boolean isSimpleType()
NonElement
NonElement
maps to text in XML,
without any attribute nor child elements.isSimpleType
in interface NonElement<NType,NClass>
public String fullName()
fullName
in interface CClassInfoParent
fullName
in interface NType
public CClassInfoParent parent()
public void setUserSpecifiedImplClass(String implClass)
public String getUserSpecifiedImplClass()
public void addProperty(CPropertyInfo prop)
public void setBaseClass(CClass base)
CClassInfo
(which means the base class
is also generated), or CClassRef
(which means the base class is
already generated and simply referenced.)
The latter is treated somewhat special --- from the rest of the model
this external base class is invisible. This modeling might need more
thoughts to get right.public CClassInfo getBaseClass()
CClassRef
.getBaseClass
in interface ClassInfo<NType,NClass>
Object
.getRefBaseClass()
public CClassRef getRefBaseClass()
public Iterator<CClassInfo> listSubclasses()
public CClassInfo getSubstitutionHead()
Element
Substitutability of elements are transitive.
getSubstitutionHead
in interface Element<NType,NClass>
public void _implements(JClass c)
public void addConstructor(String... fieldNames)
public Collection<? extends Constructor> getConstructors()
public final <T> T accept(CClassInfoParent.Visitor<T> visitor)
accept
in interface CClassInfoParent
public JPackage getOwnerPackage()
CClassInfoParent
JPackage
.getOwnerPackage
in interface CClassInfoParent
public final NClass getType()
TypeInfo
public final JClass toType(Outline o, Aspect aspect)
CTypeInfo
toType
in interface CTypeInfo
toType
in interface NClass
toType
in interface NType
aspect
- If Aspect.IMPLEMENTATION
, this method returns the
implementation specific class that this type represents.
If Aspect.EXPOSED
, this method returns the
publicly exposed type that this type represents.
For ordinary classes, the aspect parameter is meaningless.NType.toType(Outline, com.sun.tools.xjc.outline.Aspect)
public boolean isBoxedType()
NType
String
this is false, but for Integer
this is true.isBoxedType
in interface NType
public Locator getLocator()
CCustomizable
getLocator
in interface CCustomizable
public boolean isAbstract()
CElement
isAbstract
in interface CElement
public void setAbstract()
CElement
setAbstract
in interface CElement
public final boolean isCollection()
public final CAdapter getAdapterUse()
public final ID idUse()
public final com.sun.xml.xsom.XSComponent getSchemaComponent()
CCustomizable
getSchemaComponent
in interface CCustomizable
public final boolean canBeReferencedByIDREF()
TypeInfo
XmlIDREF
.canBeReferencedByIDREF
in interface TypeInfo<NType,NClass>
public CCustomizations getCustomizations()
CCustomizable
getCustomizations
in interface CCustomizable
Plugin.getCustomizationURIs()
public JExpression createConstant(Outline outline, com.sun.xml.xsom.XmlString lexical)
public final Locatable getUpstream()
Locatable
Location
information.getUpstream
in interface Locatable
public final Location getLocation()
Locatable
getLocation
in interface Locatable
Copyright © 2019 JBoss by Red Hat. All rights reserved.