org.xwiki.model.reference
Class DocumentReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
      extended by org.xwiki.model.reference.DocumentReference
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EntityReference>

public class DocumentReference
extends EntityReference

Represents a reference to a document (wiki, space and page names).

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

Constructor Summary
DocumentReference(EntityReference reference)
          Special constructor that transforms a generic entity reference into a DocumentReference.
DocumentReference(String wikiName, List<String> spaceNames, String pageName)
           
DocumentReference(String pageName, SpaceReference parent)
           
DocumentReference(String wikiName, String spaceName, String pageName)
           
 
Method Summary
 SpaceReference getLastSpaceReference()
           
 List<SpaceReference> getSpaceReferences()
           
 WikiReference getWikiReference()
           
 void setParent(EntityReference parent)
           Overridden in order to verify the validity of the passed parent
 void setType(EntityType type)
           Overridden in order to verify the validity of the passed type
 void setWikiReference(WikiReference newWikiReference)
           
 
Methods inherited from class org.xwiki.model.reference.EntityReference
clone, compareTo, equals, extractReference, getChild, getName, getParent, getRoot, getType, hashCode, setChild, setName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentReference

public DocumentReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a DocumentReference. It checks the validity of the passed reference (ie correct type and correct parent).

Throws:
IllegalArgumentException - if the passed reference is not a valid document reference

DocumentReference

public DocumentReference(String wikiName,
                         String spaceName,
                         String pageName)

DocumentReference

public DocumentReference(String wikiName,
                         List<String> spaceNames,
                         String pageName)

DocumentReference

public DocumentReference(String pageName,
                         SpaceReference parent)
Method Detail

setParent

public void setParent(EntityReference parent)
Overridden in order to verify the validity of the passed parent

Overrides:
setParent in class EntityReference
Throws:
IllegalArgumentException - if the passed parent is not a valid document reference parent (ie a space reference)
See Also:
EntityReference.setParent(EntityReference)

setType

public void setType(EntityType type)
Overridden in order to verify the validity of the passed type

Overrides:
setType in class EntityReference
Throws:
IllegalArgumentException - if the passed type is not a document type
See Also:
EntityReference.setType(org.xwiki.model.EntityType)

getWikiReference

public WikiReference getWikiReference()

setWikiReference

public void setWikiReference(WikiReference newWikiReference)

getLastSpaceReference

public SpaceReference getLastSpaceReference()

getSpaceReferences

public List<SpaceReference> getSpaceReferences()


Copyright © 2004-2011 XWiki. All Rights Reserved.