org.xwiki.model.reference
Class EntityReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EntityReference>
Direct Known Subclasses:
AttachmentReference, ClassPropertyReference, DocumentReference, ObjectPropertyReference, ObjectReference, RegexEntityReference, SpaceReference, WikiReference

public class EntityReference
extends Object
implements Serializable, Cloneable, Comparable<EntityReference>

Represents a reference to an Entity (Document, Attachment, Space, Wiki, etc).

Since:
2.2M1
Version:
$Id$
See Also:
Serialized Form

Constructor Summary
EntityReference(String name, EntityType type)
           
EntityReference(String name, EntityType type, EntityReference parent)
           
 
Method Summary
 EntityReference clone()
          
 int compareTo(EntityReference reference)
          
 boolean equals(Object obj)
          
 EntityReference extractReference(EntityType type)
           
 EntityReference getChild()
           
 String getName()
           
 EntityReference getParent()
           
 EntityReference getRoot()
           
 EntityType getType()
           
 int hashCode()
          
 void setChild(EntityReference child)
           
 void setName(String name)
           
 void setParent(EntityReference parent)
           
 void setType(EntityType type)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityReference

public EntityReference(String name,
                       EntityType type)

EntityReference

public EntityReference(String name,
                       EntityType type,
                       EntityReference parent)
Method Detail

setName

public void setName(String name)
Throws:
IllegalArgumentException - if the passed name is null or empty

getName

public String getName()

setParent

public void setParent(EntityReference parent)

getParent

public EntityReference getParent()

setChild

public void setChild(EntityReference child)

getChild

public EntityReference getChild()

setType

public void setType(EntityType type)
Throws:
IllegalArgumentException - if the passed type is null

getType

public EntityType getType()

getRoot

public EntityReference getRoot()

extractReference

public EntityReference extractReference(EntityType type)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

clone

public EntityReference clone()

Overrides:
clone in class Object
See Also:
Object.clone()

compareTo

public int compareTo(EntityReference reference)

Specified by:
compareTo in interface Comparable<EntityReference>
See Also:
Comparable.compareTo(Object)


Copyright © 2004-2011 XWiki. All Rights Reserved.