public abstract class AbstractReference<T extends Referenceable> extends Object implements Reference<T>
Note: Client code should always check for brokeness before access the referenced.
Constructor and Description |
---|
AbstractReference(Class<T> referencedType,
AbstractComponent parent,
String ref)
Constructor for reading.
|
AbstractReference(T referenced,
Class<T> referencedType,
AbstractComponent parent)
Constructor for writing.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
protected AbstractComponent |
getParent() |
protected T |
getReferenced()
Access method for referenced.
|
String |
getRefString() |
Class<T> |
getType()
Returns type of the referenced component
|
int |
hashCode() |
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 the target component.
|
protected void |
setReferenced(T referenced)
Accessor method for referenced.
|
String |
toString() |
protected String refString
public AbstractReference(T referenced, Class<T> referencedType, AbstractComponent parent)
referenced
- the component being referencedreferencedType
- type of the referenced componentparent
- referencing component on which the referenced is serialized
as an attribute string value.public AbstractReference(Class<T> referencedType, AbstractComponent parent, String ref)
referencedType
- type of the referenced componentparent
- referencing component on which the referenced is serialized
as an attribute string value.ref
- the string value used in resolving.protected T getReferenced()
protected void setReferenced(T referenced)
public Class<T> getType()
getType
in interface Reference<T extends Referenceable>
public boolean isBroken()
isBroken
in interface Reference<T extends Referenceable>
public boolean references(T target)
references
in interface Reference<T extends Referenceable>
public String getRefString()
getRefString
in interface Reference<T extends Referenceable>
protected AbstractComponent getParent()