org.netbeans.modules.xml.xam/1 1.18.0 1

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

All Known Subinterfaces:
NamedComponentReference<T>
All Known Implementing Classes:
AbstractNamedComponentReference, AbstractReference

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.


Method Summary
 T get()
           
 String getRefString()
           
 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

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

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

org.netbeans.modules.xml.xam/1 1.18.0 1

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.