public final class CElementInfo extends Object implements ElementInfo<NType,NClass>, NType, CClassInfoParent
ElementInfo
implementation for the compile-time model.
As an NType, it represents the Java representation of this element (either JAXBElement<T> or Foo).
CClassInfoParent.Package, CClassInfoParent.Visitor<T>
Modifier and Type | Field and Description |
---|---|
CClassInfoParent |
parent
If this element is global, the element info is considered to be
package-level, and this points to the package in which this element
lives in.
|
Constructor and Description |
---|
CElementInfo(Model model,
QName tagName,
CClassInfoParent parent,
String className,
CCustomizations customizations,
Locator location)
Creates an element with a class in the given parent.
|
CElementInfo(Model model,
QName tagName,
CClassInfoParent parent,
TypeUse contentType,
com.sun.xml.xsom.XmlString defaultValue,
com.sun.xml.xsom.XSElementDecl source,
CCustomizations customizations,
Locator location)
Creates an element in the given parent.
|
Modifier and Type | Method and Description |
---|---|
JPackage |
_package() |
<T> T |
accept(CClassInfoParent.Visitor<T> visitor) |
boolean |
canBeReferencedByIDREF()
Deprecated.
why are you calling an unimplemented method?
|
JExpression |
createConstant(Outline outline,
com.sun.xml.xsom.XmlString lexical) |
String |
fullName()
Human readable name of this type.
|
CAdapter |
getAdapterUse() |
NType |
getContentInMemoryType()
T of
JAXBElement<T> . |
CNonElement |
getContentType()
Short for
getProperty().ref().get(0) . |
CCustomizations |
getCustomizations()
Gets the list of customizations attached to this model component.
|
String |
getDefaultValue() |
QName |
getElementName()
Gets the element name of the class.
|
MimeType |
getExpectedMimeType()
No default
MimeType . |
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.
|
JPackage |
getOwnerPackage()
Gets the nearest
JPackage . |
CElementPropertyInfo |
getProperty()
Gets the object that represents the value property.
|
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 element.
|
CElementInfo |
getSubstitutionHead()
If this element can substitute another element, return that element.
|
Collection<CElementInfo> |
getSubstitutionMembers()
All the
ElementInfo s whose ElementInfo.getSubstitutionHead() points
to this object. |
NType |
getType()
Deprecated.
why are you calling a method that returns this?
|
Locatable |
getUpstream()
Gets the upstream
Location information. |
boolean |
hasClass()
True if this element has its own class
(as opposed to be represented as an instance of
JAXBElement . |
ID |
idUse() |
void |
initContentType(TypeUse contentType,
com.sun.xml.xsom.XSElementDecl source,
com.sun.xml.xsom.XmlString defaultValue) |
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() |
void |
setAbstract()
Marks this element as an abstract element.
|
void |
setSubstitutionHead(CElementInfo substitutionHead) |
String |
shortName() |
JType |
toType(Outline o,
Aspect aspect)
Returns the representation of this type in code model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canBeReferencedByIDREF
getLocation, getUpstream
getCustomizations, getSchemaComponent
public final CClassInfoParent parent
For local elements, this points to the parent CClassInfo
.
public CElementInfo(Model model, QName tagName, CClassInfoParent parent, TypeUse contentType, com.sun.xml.xsom.XmlString defaultValue, com.sun.xml.xsom.XSElementDecl source, CCustomizations customizations, Locator location)
When using this construction, initContentType(TypeUse, XSElementDecl, XmlString)
must not be invoked.
public CElementInfo(Model model, QName tagName, CClassInfoParent parent, String className, CCustomizations customizations, Locator location)
When using this construction, the caller must use
initContentType(TypeUse, XSElementDecl, XmlString)
to fill in the content type
later.
This is to avoid a circular model construction dependency between buidling a type
inside an element and element itself. To build a content type, you need to have
CElementInfo
for a parent, so we can't take it as a constructor parameter.
public void initContentType(TypeUse contentType, @Nullable com.sun.xml.xsom.XSElementDecl source, com.sun.xml.xsom.XmlString defaultValue)
public final String getDefaultValue()
public final JPackage _package()
public CNonElement getContentType()
ElementInfo
getProperty().ref().get(0)
.
The type of the value this element holds.
Normally, this is the T of JAXBElement<T>
.
But if the property is adapted, this is the on-the-wire type.
Or if the element has a list of values, then this field
represents the type of the individual item.getContentType
in interface ElementInfo<NType,NClass>
ElementInfo.getContentInMemoryType()
public NType getContentInMemoryType()
ElementInfo
JAXBElement<T>
.
This is tied to the in-memory representation.
getContentInMemoryType
in interface ElementInfo<NType,NClass>
ElementInfo.getContentType()
public CElementPropertyInfo getProperty()
ElementInfo
getProperty
in interface ElementInfo<NType,NClass>
public CClassInfo getScope()
Element
public NType getType()
ElementInfo
JAXBElement
<contentInMemoryType>.
This returns the signature in Java and thus isn't affected by the adapter.
public QName getElementName()
Element
getElementName
in interface Element<NType,NClass>
public JType toType(Outline o, Aspect aspect)
NType
This operation requires the whole model to be built,
and hence it takes Outline
.
Under some code generation strategy, some bean classes are considered implementation specific (such as impl.FooImpl class) These classes always have accompanying "exposed" type (such as the Foo interface).
For such Jekyll and Hyde type, the aspect parameter determines which personality is returned.
toType
in interface CTypeInfo
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, Aspect)
public String getSqueezedName()
CClassInfo.getSqueezedName()
public CElementInfo getSubstitutionHead()
Element
Substitutability of elements are transitive.
getSubstitutionHead
in interface Element<NType,NClass>
getSubstitutionHead
in interface ElementInfo<NType,NClass>
public Collection<CElementInfo> getSubstitutionMembers()
ElementInfo
ElementInfo
s whose ElementInfo.getSubstitutionHead()
points
to this object.getSubstitutionMembers
in interface ElementInfo<NType,NClass>
public void setSubstitutionHead(CElementInfo substitutionHead)
public boolean isBoxedType()
NType
String
this is false, but for Integer
this is true.isBoxedType
in interface NType
public String fullName()
NType
fullName
in interface CClassInfoParent
fullName
in interface NType
public <T> T accept(CClassInfoParent.Visitor<T> visitor)
accept
in interface CClassInfoParent
public JPackage getOwnerPackage()
CClassInfoParent
JPackage
.getOwnerPackage
in interface CClassInfoParent
public String shortName()
public boolean hasClass()
JAXBElement
.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 © 2017 JBoss by Red Hat. All rights reserved.