org.codehaus.enunciate.contract.jaxb
Class ElementRef

java.lang.Object
  extended by net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
      extended by net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
          extended by org.codehaus.enunciate.contract.jaxb.Accessor
              extended by org.codehaus.enunciate.contract.jaxb.Element
                  extended by org.codehaus.enunciate.contract.jaxb.ElementRef
All Implemented Interfaces:
com.sun.mirror.declaration.Declaration, com.sun.mirror.declaration.MemberDeclaration, Adaptable

public class ElementRef
extends Element

An accessor that is marshalled in xml to an xml element.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
delegate, javaDoc
 
Constructor Summary
  ElementRef(com.sun.mirror.declaration.MemberDeclaration delegate, TypeDefinition typedef)
           
protected ElementRef(com.sun.mirror.declaration.MemberDeclaration delegate, TypeDefinition typedef, javax.xml.bind.annotation.XmlElementRef xmlElementRef)
          Construct an element accessor with a specific element ref annotation.
 
Method Summary
 com.sun.mirror.type.TypeMirror getAccessorType()
          The type of an element ref accessor can be specified by an annotation.
 XmlType getBaseType()
          There is no base type for an element ref.
 java.util.Collection<ElementRef> getChoices()
          The choices for this element.
protected  com.sun.mirror.apt.AnnotationProcessorEnvironment getEnv()
          The current environment.
 java.lang.String getJsonMemberName()
          Get the name for the JSON member to which this element will be serialized.
 int getMinOccurs()
          The min occurs of an element ref is 0
 java.lang.String getName()
          The name of an element ref is the name of the element it references, unless the type is a JAXBElement, in which case the name is specified.
 java.lang.String getNamespace()
          The namespace of an element ref is the namespace of the element it references, unless the type is a JAXBElement, in which case the namespace is specified.
 javax.xml.namespace.QName getRef()
          The ref for this element ref.
 boolean isBinaryData()
          An element ref is not binary data.
 boolean isElementRef()
          Whether this accessor is an element ref.
 boolean isElementRefs()
          Whether this is a choice of multiple element refs.
protected  boolean isInstanceOf(com.sun.mirror.declaration.ClassDeclaration classDeclaration, java.lang.String fqn)
          Determines whether the class declaration is an instance of the declared type of the given fully-qualified name.
 boolean isMTOMAttachment()
          An element ref is not an MTOM attachment.
 boolean isNillable()
          An element ref is not nillable.
 boolean isQNameType()
          Whether this access is a QName type.
 boolean isRequired()
          An element ref is not required.
 boolean isSwaRef()
          An element ref is not a swa ref.
protected  javax.xml.namespace.QName loadRef()
          Load the qname of the referenced root element declaration.
 
Methods inherited from class org.codehaus.enunciate.contract.jaxb.Element
getAccessorType, getDefaultValue, getForm, getMaxOccurs, getWrapperName, getWrapperNamespace, isWrapped, isWrapperNillable
 
Methods inherited from class org.codehaus.enunciate.contract.jaxb.Accessor
getAccessorForXmlID, getAdapterType, getBareAccessorType, getClientSimpleName, getCollectionItemType, getMimeType, getQNameEnumRef, getReferencedFrom, getSeeAlsos, getTypeDefinition, isAdapted, isAttribute, isCollectionType, isReferencesQNameEnum, isValue, isXmlID, isXmlIDREF, isXmlList
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
accept, getDeclaringType
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
constructJavaDoc, equals, getAnnotation, getAnnotationMirrors, getAnnotations, getDelegate, getDocComment, getDocValue, getJavaDoc, getModifiers, getPosition, getSimpleName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Constructor Detail

ElementRef

public ElementRef(com.sun.mirror.declaration.MemberDeclaration delegate,
                  TypeDefinition typedef)

ElementRef

protected ElementRef(com.sun.mirror.declaration.MemberDeclaration delegate,
                     TypeDefinition typedef,
                     javax.xml.bind.annotation.XmlElementRef xmlElementRef)
Construct an element accessor with a specific element ref annotation.

Parameters:
delegate - The delegate.
typedef - The type definition.
xmlElementRef - The specific element ref annotation.
Method Detail

isInstanceOf

protected boolean isInstanceOf(com.sun.mirror.declaration.ClassDeclaration classDeclaration,
                               java.lang.String fqn)
Determines whether the class declaration is an instance of the declared type of the given fully-qualified name.

Parameters:
classDeclaration - The class declaration.
fqn - The FQN.
Returns:
Whether the class declaration is an instance of the declared type of the given fully-qualified name.

loadRef

protected javax.xml.namespace.QName loadRef()
Load the qname of the referenced root element declaration.

Returns:
the qname of the referenced root element declaration.

isElementRefs

public boolean isElementRefs()
Whether this is a choice of multiple element refs.

Overrides:
isElementRefs in class Element
Returns:
Whether this is a choice of multiple element refs.

getName

public java.lang.String getName()
The name of an element ref is the name of the element it references, unless the type is a JAXBElement, in which case the name is specified.

Overrides:
getName in class Element
Returns:
The name of the element ref.

getNamespace

public java.lang.String getNamespace()
The namespace of an element ref is the namespace of the element it references, unless the type is a JAXBElement, in which case the namespace is specified.

Overrides:
getNamespace in class Element
Returns:
The namespace of the element ref.

getRef

public javax.xml.namespace.QName getRef()
The ref for this element ref.

Overrides:
getRef in class Element
Returns:
The ref.

getBaseType

public XmlType getBaseType()
There is no base type for an element ref.

Overrides:
getBaseType in class Element
Returns:
The base type.
Throws:
java.lang.UnsupportedOperationException - Because there is no such things as a base type for an element ref.

isQNameType

public boolean isQNameType()
Description copied from class: Accessor
Whether this access is a QName type.

Overrides:
isQNameType in class Accessor
Returns:
Whether this access is a QName type.

getAccessorType

public com.sun.mirror.type.TypeMirror getAccessorType()
The type of an element ref accessor can be specified by an annotation.

Overrides:
getAccessorType in class Element
Returns:
The accessor type.

isBinaryData

public boolean isBinaryData()
An element ref is not binary data. It may refer to an element that is binary data, though...

Overrides:
isBinaryData in class Accessor
Returns:
false

isSwaRef

public boolean isSwaRef()
An element ref is not a swa ref. In may refer to an element that is a swa ref, though...

Overrides:
isSwaRef in class Accessor
Returns:
false

isMTOMAttachment

public boolean isMTOMAttachment()
An element ref is not an MTOM attachment. It may refer to an element that is an MTOM attachment, though...

Overrides:
isMTOMAttachment in class Accessor
Returns:
false

isNillable

public boolean isNillable()
An element ref is not nillable.

Overrides:
isNillable in class Element
Returns:
false

isRequired

public boolean isRequired()
An element ref is not required.

Overrides:
isRequired in class Element
Returns:
false.

getMinOccurs

public int getMinOccurs()
The min occurs of an element ref is 0

Overrides:
getMinOccurs in class Element
Returns:
0

getChoices

public java.util.Collection<ElementRef> getChoices()
The choices for this element.

Overrides:
getChoices in class Element
Returns:
The choices for this element.

getEnv

protected com.sun.mirror.apt.AnnotationProcessorEnvironment getEnv()
The current environment.

Returns:
The current environment.

isElementRef

public boolean isElementRef()
Description copied from class: Accessor
Whether this accessor is an element ref.

Overrides:
isElementRef in class Accessor
Returns:
Whether this accessor is an element ref.

getJsonMemberName

public java.lang.String getJsonMemberName()
Description copied from class: Accessor
Get the name for the JSON member to which this element will be serialized.

Overrides:
getJsonMemberName in class Element
Returns:
The JSON member name.