com.sun.tools.xjc.model
Class CElementPropertyInfo

java.lang.Object
  extended by com.sun.tools.xjc.model.CPropertyInfo
      extended by com.sun.tools.xjc.model.CElementPropertyInfo
All Implemented Interfaces:
CCustomizable, com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>, com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>

public final class CElementPropertyInfo
extends CPropertyInfo
implements com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

ElementPropertyInfo for the compiler.


Nested Class Summary
static class CElementPropertyInfo.CollectionMode
           
 
Field Summary
 
Fields inherited from class com.sun.tools.xjc.model.CPropertyInfo
baseType, defaultValue, javadoc, locator, realization, schemaType
 
Constructor Summary
CElementPropertyInfo(java.lang.String name, CElementPropertyInfo.CollectionMode collection, com.sun.xml.bind.v2.model.core.ID id, javax.activation.MimeType expectedMimeType, com.sun.xml.xsom.XSComponent source, CCustomizations customizations, org.xml.sax.Locator locator, boolean required)
           
 
Method Summary
<V> V
accept(CPropertyVisitor<V> visitor)
           
 CAdapter getAdapter()
           
 javax.activation.MimeType getExpectedMimeType()
           
 java.util.List<CTypeRef> getTypes()
           
 javax.xml.namespace.QName getXmlName()
          XJC never uses the wrapper element.
 com.sun.xml.bind.v2.model.core.ID id()
           
 boolean isCollectionNillable()
           
 boolean isOptionalPrimitive()
          Returns true if this property needs to represent null just for the purpose of representing an absence of the property.
 boolean isRequired()
           
 boolean isUnboxable()
          Returns true if this property is "unboxable".
 boolean isValueList()
           
 com.sun.xml.bind.v2.model.core.PropertyKind kind()
           
 java.util.List<CNonElement> ref()
           
 void setAdapter(CAdapter a)
           
 
Methods inherited from class com.sun.tools.xjc.model.CPropertyInfo
displayName, getCustomizations, getLocator, getName, getName, getSchemaComponent, getSchemaType, inlineBinaryData, isCollection, parent, setParent
 
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
displayName, getName, getSchemaType, inlineBinaryData, isCollection, parent
 

Constructor Detail

CElementPropertyInfo

public CElementPropertyInfo(java.lang.String name,
                            CElementPropertyInfo.CollectionMode collection,
                            com.sun.xml.bind.v2.model.core.ID id,
                            javax.activation.MimeType expectedMimeType,
                            com.sun.xml.xsom.XSComponent source,
                            CCustomizations customizations,
                            org.xml.sax.Locator locator,
                            boolean required)
Method Detail

id

public com.sun.xml.bind.v2.model.core.ID id()
Specified by:
id in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>

getTypes

public java.util.List<CTypeRef> getTypes()
Specified by:
getTypes in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

ref

public java.util.List<CNonElement> ref()
Specified by:
ref in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
Specified by:
ref in class CPropertyInfo

getXmlName

public javax.xml.namespace.QName getXmlName()
XJC never uses the wrapper element. Always return null.

Specified by:
getXmlName in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

isCollectionNillable

public boolean isCollectionNillable()
Specified by:
isCollectionNillable in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

isRequired

public boolean isRequired()
Specified by:
isRequired in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

isValueList

public boolean isValueList()
Specified by:
isValueList in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>

isUnboxable

public boolean isUnboxable()
Description copied from class: CPropertyInfo
Returns true if this property is "unboxable".

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.

Overrides:
isUnboxable in class CPropertyInfo

isOptionalPrimitive

public boolean isOptionalPrimitive()
Description copied from class: CPropertyInfo
Returns true if this property needs to represent null just for the purpose of representing an absence of the property.

Overrides:
isOptionalPrimitive in class CPropertyInfo

accept

public <V> V accept(CPropertyVisitor<V> visitor)
Specified by:
accept in class CPropertyInfo

getAdapter

public CAdapter getAdapter()
Specified by:
getAdapter in interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo<NType,NClass>
Specified by:
getAdapter in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>
Specified by:
getAdapter in class CPropertyInfo

setAdapter

public void setAdapter(CAdapter a)

kind

public final com.sun.xml.bind.v2.model.core.PropertyKind kind()
Specified by:
kind in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>

getExpectedMimeType

public javax.activation.MimeType getExpectedMimeType()
Specified by:
getExpectedMimeType in interface com.sun.xml.bind.v2.model.core.PropertyInfo<NType,NClass>