|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.xjc.model.CPropertyInfo
public abstract class CPropertyInfo
Field Summary | |
---|---|
com.sun.codemodel.JType |
baseType
If the base type of the property is overriden, this field is set to non-null. |
CDefaultValue |
defaultValue
If non-null, keeps the default value in Java representation. |
java.lang.String |
javadoc
Javadoc for this property. |
org.xml.sax.Locator |
locator
|
FieldRenderer |
realization
Specifies how the field is generated by the backedn. |
javax.xml.namespace.QName |
schemaType
|
Constructor Summary | |
---|---|
protected |
CPropertyInfo(java.lang.String name,
boolean collection,
com.sun.xml.xsom.XSComponent source,
CCustomizations customizations,
org.xml.sax.Locator locator)
|
Method Summary | ||
---|---|---|
abstract
|
accept(CPropertyVisitor<V> visitor)
|
|
java.lang.String |
displayName()
|
|
abstract CAdapter |
getAdapter()
|
|
CCustomizations |
getCustomizations()
Gets the list of customizations attached to this model component. |
|
org.xml.sax.Locator |
getLocator()
Gets the source location in the schema from which this model component is created. |
|
java.lang.String |
getName()
Deprecated. marked as deprecated so that we can spot the use of this method. |
|
java.lang.String |
getName(boolean isPublic)
Gets the name of the 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. |
|
javax.xml.namespace.QName |
getSchemaType()
|
|
boolean |
inlineBinaryData()
Deprecated. if you are calling this method directly, there's something wrong. |
|
boolean |
isCollection()
|
|
boolean |
isOptionalPrimitive()
Returns true if this property needs to represent null just for the purpose of representing an absence of the property. |
|
boolean |
isUnboxable()
Returns true if this property is "unboxable". |
|
CTypeInfo |
parent()
|
|
abstract java.util.Collection<? extends CTypeInfo> |
ref()
|
|
(package private) void |
setParent(CClassInfo parent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.xml.bind.v2.model.core.PropertyInfo |
---|
getExpectedMimeType, id, kind |
Field Detail |
---|
public final org.xml.sax.Locator locator
public com.sun.codemodel.JType baseType
public java.lang.String javadoc
public FieldRenderer realization
public CDefaultValue defaultValue
isCollection
is true, this field is always null,
for we don't handle default values for a list.
public javax.xml.namespace.QName schemaType
getSchemaType()
Constructor Detail |
---|
protected CPropertyInfo(java.lang.String name, boolean collection, com.sun.xml.xsom.XSComponent source, CCustomizations customizations, org.xml.sax.Locator locator)
Method Detail |
---|
final void setParent(CClassInfo parent)
public CTypeInfo parent()
parent
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public org.xml.sax.Locator getLocator()
CCustomizable
getLocator
in interface CCustomizable
public final com.sun.xml.xsom.XSComponent getSchemaComponent()
getSchemaComponent
in interface CCustomizable
public abstract CAdapter getAdapter()
getAdapter
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public java.lang.String getName()
This method is implemented to follow the contract of
PropertyInfo.getName()
, and therefore it always
returns the name of the annotated field.
This name is normally not useful for the rest of XJC, which usually wants to access the "public name" of the property. A "public name" of the property is a name like "FooBar" which is used as a seed for generating the accessor methods. This is the name controlled by the schema customization via users.
If the caller is calling this method statically, it's usually
the sign of a mistake. Use getName(boolean)
method instead,
which forces you to think about which name you want to get.
getName
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
getName(boolean)
public java.lang.String getName(boolean isPublic)
isPublic
- if true, this method returns a name like "FooBar", which
should be used as a seed for generating user-visible names
(such as accessors like "getFooBar".)
if false, this method returns the "name of the property" as defined in the j2s side of the spec. This name is usually something like "fooBar", which often corresponds to the XML element/attribute name of this property (for taking advantage of annotation defaulting as much as possible)
public java.lang.String displayName()
displayName
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public boolean isCollection()
isCollection
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public abstract java.util.Collection<? extends CTypeInfo> ref()
ref
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public boolean isUnboxable()
In general, a property often has to be capable of representing null to indicate the absence of the value. This requires properties to be generated as @XmlElement Float f, not as @XmlElement float f;. But this is slow.
Fortunately, there are cases where we know that the property can never legally be absent. When this condition holds we can generate the optimized "unboxed form".
The exact such conditions depend on the kind of properties, so refer to the implementation code for the details.
This method returns true when the property can be generated as "unboxed form", false otherwise.
When this property is a collection, this method returns true if items in the collection is unboxable. Obviously, the collection itself is always a reference type.
public boolean isOptionalPrimitive()
public CCustomizations getCustomizations()
CCustomizable
getCustomizations
in interface CCustomizable
Plugin.getCustomizationURIs()
public javax.xml.namespace.QName getSchemaType()
getSchemaType
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public boolean inlineBinaryData()
inlineBinaryData
in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
public abstract <V> V accept(CPropertyVisitor<V> visitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |