org.xwiki.model.reference
Class AttachmentReference
java.lang.Object
org.xwiki.model.reference.EntityReference
org.xwiki.model.reference.AttachmentReference
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<EntityReference>
public class AttachmentReference
- extends EntityReference
Represents a reference to an Attachment (document reference and file name). Note that an attachment is always
attached to a document.
- Since:
- 2.2M1
- Version:
- $Id$
- See Also:
- Serialized Form
| Methods inherited from class org.xwiki.model.reference.EntityReference |
clone, compareTo, equals, extractReference, getChild, getName, getParent, getRoot, getType, hashCode, setChild, setName, toString |
AttachmentReference
public AttachmentReference(EntityReference reference)
- Special constructor that transforms a generic entity reference into an
AttachmentReference. It checks the
validity of the passed reference (ie correct type and correct parent).
- Throws:
IllegalArgumentException - if the passed reference is not a valid attachment reference
AttachmentReference
public AttachmentReference(String fileName,
DocumentReference parent)
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 attachment reference parent (ie an
attachment 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 an attachment type- See Also:
EntityReference.setType(org.xwiki.model.EntityType)
getDocumentReference
public DocumentReference getDocumentReference()
Copyright © 2004-2011 XWiki. All Rights Reserved.