org.netbeans.modules.xml.xam
Interface Reference<T extends Referenceable>

All Known Subinterfaces:
BpelReference<T>, NamedComponentReference<T>, Reference<T>, SchemaReference<T>, WSDLReference<T>, WSDLReference<T>
All Known Implementing Classes:
AbstractNamedComponentReference, AbstractNamedComponentReference, AbstractReference, AbstractReference, BindingFaultImpl.FaultReference, BindingInputImpl.InputReference, BindingOutputImpl.OutputReference, BpelReferenceImpl, GlobalReferenceImpl, GlobalWSDLReferenceImpl, OperationReference, SchemaReferenceImpl, WSDLReferenceImpl

public interface Reference<T extends Referenceable>

Represents reference to a component. On writing, this indirection help serialize the referenced component as an attribute string value. On reading, the referenced can be resolved on demand.

Note: Client code should always check for brokeness before access the referenced.

Author:
Chris Webster, Rico Cruz, Nam Nguyen

Method Summary
 T get()
           
 java.lang.String getRefString()
           
 java.lang.Class<T> getType()
          Returns type of the referenced.
 boolean isBroken()
          Returns true if the reference cannot be resolved in the current document
 boolean references(T target)
          Returns true if this reference refers to target.
 

Method Detail

get

T get()
Returns:
the referenced component. May return null if #isBroken() returns true;

getType

java.lang.Class<T> getType()
Returns type of the referenced.


isBroken

boolean isBroken()
Returns true if the reference cannot be resolved in the current document


references

boolean references(T target)
Returns true if this reference refers to target.

Note: In some implementation, this method could be more efficient than invoking #get() for direct checking.


getRefString

java.lang.String getRefString()
Returns:
string to use in persiting the reference as attribute string value of the containing component