org.codehaus.enunciate.contract.jaxws
Class WebFault

java.lang.Object
  extended by net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
      extended by net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
          extended by net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration
              extended by net.sf.jelly.apt.decorations.declaration.DecoratedClassDeclaration
                  extended by org.codehaus.enunciate.contract.jaxws.WebFault
All Implemented Interfaces:
com.sun.mirror.declaration.ClassDeclaration, com.sun.mirror.declaration.Declaration, com.sun.mirror.declaration.MemberDeclaration, com.sun.mirror.declaration.TypeDeclaration, ImplicitRootElement, ImplicitSchemaElement, WebMessage, WebMessagePart

public class WebFault
extends net.sf.jelly.apt.decorations.declaration.DecoratedClassDeclaration
implements WebMessage, WebMessagePart, ImplicitRootElement

A fault that is declared potentially thrown in some web service call.

Author:
Ryan Heaton

Nested Class Summary
static class WebFault.FaultBeanChildElement
           
 
Nested classes/interfaces inherited from interface org.codehaus.enunciate.contract.jaxws.WebMessagePart
WebMessagePart.ParticleType
 
Field Summary
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
delegate, javaDoc
 
Constructor Summary
WebFault(com.sun.mirror.declaration.ClassDeclaration delegate)
           
 
Method Summary
protected  java.lang.String calculateNamespaceURI()
          Calculates a namespace URI for a given package.
 ElementDeclaration findExplicitFaultBean()
          A web fault has an explicit fault bean if all three of the following are present:

A getFaultInfo method that returns the bean instance of a class type.

protected  java.util.Collection<net.sf.jelly.apt.decorations.declaration.PropertyDeclaration> getAllFaultProperties(net.sf.jelly.apt.decorations.declaration.DecoratedClassDeclaration declaration)
          Gets all properties, including properties from the superclass.
 java.util.Collection<ImplicitChildElement> getChildElements()
          If this is an implicit fault bean, return the child elements.
 java.lang.String getClientSimpleName()
          The simple name for client-side code generation.
 java.lang.String getElementDocs()
          The comments on the fault itself.
 java.lang.String getElementName()
          The element name of the implicit web fault bean, or null if this isn't an implicit web fault.
 com.sun.mirror.type.ClassType getExplicitFaultBeanType()
          A web fault has an explicit fault bean if all three of the following are present:

A getFaultInfo method that returns the bean instance of a class type.

 java.lang.String getImplicitFaultBeanQualifiedName()
          The qualified name of the implicit fault bean of this web fault, or null if this web fault does not define an implicit faul bean.
 java.lang.String getMessageDocs()
          The message documentation for a fault is the documentation for its type.
 java.lang.String getMessageName()
          The message name of this fault.
 java.lang.String getPartDocs()
          The documentation for this web message part.
 javax.xml.namespace.QName getParticleQName()
          The qname reference to the fault info.
 WebMessagePart.ParticleType getParticleType()
          The particle type for this part.
 java.lang.String getPartName()
          The part name of this web fault as it would appear in wsdl.
 java.util.Collection<WebMessagePart> getParts()
          There's only one part to a web fault.
 java.lang.String getTargetNamespace()
          Gets the target namespace of the implicit fault bean, or null if this web fault defines an explicit fault info bean.
 javax.xml.namespace.QName getTypeQName()
          If there is an explicit fault bean, it will be a root schema element referencing its own type.
 WebMethod getWebMethod()
          The web method associated with this part.
 boolean isFault()
          Whether this message is a web fault.
 boolean isHeader()
          Whether this message is a header parameter.
 boolean isImplicitSchemaElement()
          This web fault defines an implicit schema element if it does not have an explicit fault bean.
 boolean isInput()
          Whether this is an input message.
 boolean isOutput()
          Whether this is an output message.
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedClassDeclaration
accept, getAnnotation, getConstructors, getMethods, getSuperclass, isClass
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration
getFields, getFormalTypeParameters, getNestedTypes, getPackage, getProperties, getQualifiedName, getSuperinterfaces, isAnnotatedType, isEnum, isInterface, isPaired
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
getDeclaringType
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
constructJavaDoc, equals, 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 org.codehaus.enunciate.contract.jaxb.ImplicitSchemaElement
getPosition
 
Methods inherited from interface com.sun.mirror.declaration.TypeDeclaration
getFields, getFormalTypeParameters, getNestedTypes, getPackage, getQualifiedName, getSuperinterfaces
 
Methods inherited from interface com.sun.mirror.declaration.MemberDeclaration
getDeclaringType
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Constructor Detail

WebFault

public WebFault(com.sun.mirror.declaration.ClassDeclaration delegate)
Method Detail

getMessageName

public java.lang.String getMessageName()
The message name of this fault.

Specified by:
getMessageName in interface WebMessage
Returns:
The message name of this fault.

getMessageDocs

public java.lang.String getMessageDocs()
The message documentation for a fault is the documentation for its type.

Specified by:
getMessageDocs in interface WebMessage
Returns:
The documentation for its type.

getElementName

public java.lang.String getElementName()
The element name of the implicit web fault bean, or null if this isn't an implicit web fault.

Specified by:
getElementName in interface ImplicitSchemaElement
Returns:
The element name of the implicit web fault, or null.

getClientSimpleName

public java.lang.String getClientSimpleName()
The simple name for client-side code generation.

Returns:
The simple name for client-side code generation.

getElementDocs

public java.lang.String getElementDocs()
The comments on the fault itself.

Specified by:
getElementDocs in interface ImplicitSchemaElement
Returns:
The comments on the fault itself.

getPartName

public java.lang.String getPartName()
The part name of this web fault as it would appear in wsdl.

Specified by:
getPartName in interface WebMessagePart
Returns:
The part name of this web fault as it would appear in wsdl.

getPartDocs

public java.lang.String getPartDocs()
Description copied from interface: WebMessagePart
The documentation for this web message part.

Specified by:
getPartDocs in interface WebMessagePart
Returns:
null.

getImplicitFaultBeanQualifiedName

public java.lang.String getImplicitFaultBeanQualifiedName()
The qualified name of the implicit fault bean of this web fault, or null if this web fault does not define an implicit faul bean.

Returns:
The qualified name of the implicit fault bean of this web fault.

getExplicitFaultBeanType

public com.sun.mirror.type.ClassType getExplicitFaultBeanType()
A web fault has an explicit fault bean if all three of the following are present:

  1. A getFaultInfo method that returns the bean instance of a class type.
  2. A constructor taking a message and bean instance.
  3. A constructor taking a message, a bean instance, and a cause.

Returns:
The type of the explicit fault bean, if exists, or null otherwise.

findExplicitFaultBean

public ElementDeclaration findExplicitFaultBean()
A web fault has an explicit fault bean if all three of the following are present:

  1. A getFaultInfo method that returns the bean instance of a class type.
  2. A constructor taking a message and bean instance.
  3. A constructor taking a message, a bean instance, and a cause.

Returns:
The explicit fault bean of this web fault, if exists, or null otherwise.

getParticleType

public WebMessagePart.ParticleType getParticleType()
Description copied from interface: WebMessagePart
The particle type for this part.

Specified by:
getParticleType in interface WebMessagePart
Returns:
WebMessagePart.ParticleType.ELEMENT

getParticleQName

public javax.xml.namespace.QName getParticleQName()
The qname reference to the fault info.

Specified by:
getParticleQName in interface WebMessagePart
Returns:
The qname reference to the fault info.

getTargetNamespace

public java.lang.String getTargetNamespace()
Gets the target namespace of the implicit fault bean, or null if this web fault defines an explicit fault info bean.

Specified by:
getTargetNamespace in interface ImplicitSchemaElement
Returns:
the target namespace of the implicit fault bean, or null.

calculateNamespaceURI

protected java.lang.String calculateNamespaceURI()
Calculates a namespace URI for a given package. Default implementation uses the algorithm defined in section 3.2 of the jax-ws spec.

Returns:
The calculated namespace uri.

getTypeQName

public javax.xml.namespace.QName getTypeQName()
If there is an explicit fault bean, it will be a root schema element referencing its own type. Otherwise, the type is anonymous.

Specified by:
getTypeQName in interface ImplicitSchemaElement
Returns:
null.

isImplicitSchemaElement

public boolean isImplicitSchemaElement()
This web fault defines an implicit schema element if it does not have an explicit fault bean.

Specified by:
isImplicitSchemaElement in interface WebMessagePart
Returns:
Whether this web fault defines an implicit schema element.

getChildElements

public java.util.Collection<ImplicitChildElement> getChildElements()
If this is an implicit fault bean, return the child elements.

Specified by:
getChildElements in interface ImplicitRootElement
Returns:
The child elements of the bean, or null if none.

getAllFaultProperties

protected java.util.Collection<net.sf.jelly.apt.decorations.declaration.PropertyDeclaration> getAllFaultProperties(net.sf.jelly.apt.decorations.declaration.DecoratedClassDeclaration declaration)
Gets all properties, including properties from the superclass.

Parameters:
declaration - The declaration from which to get all properties.
Returns:
All properties.

getParts

public java.util.Collection<WebMessagePart> getParts()
There's only one part to a web fault.

Specified by:
getParts in interface WebMessage
Returns:
this.

isInput

public boolean isInput()
Description copied from interface: WebMessage
Whether this is an input message.

Specified by:
isInput in interface WebMessage
Returns:
false

isOutput

public boolean isOutput()
Description copied from interface: WebMessage
Whether this is an output message.

Specified by:
isOutput in interface WebMessage
Returns:
true

isHeader

public boolean isHeader()
Description copied from interface: WebMessage
Whether this message is a header parameter.

Specified by:
isHeader in interface WebMessage
Returns:
false

isFault

public boolean isFault()
Description copied from interface: WebMessage
Whether this message is a web fault.

Specified by:
isFault in interface WebMessage
Returns:
true

getWebMethod

public WebMethod getWebMethod()
Description copied from interface: WebMessagePart
The web method associated with this part.

Specified by:
getWebMethod in interface WebMessagePart
Returns:
The web method associated with this part.