|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.model.reference.EntityReference
org.xwiki.model.reference.AttachmentReference
public class AttachmentReference
Represents a reference to an Attachment (document reference and file name). Note that an attachment is always attached to a document.
| Constructor Summary | |
|---|---|
|
AttachmentReference(EntityReference reference)
Special constructor that transforms a generic entity reference into an AttachmentReference. |
protected |
AttachmentReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone an AttachmentReference, but replace one of the parent in the chain by a new one. |
|
AttachmentReference(String fileName,
DocumentReference parent)
Create a new attachment reference based on the attachment name and the parent document reference. |
| Method Summary | |
|---|---|
DocumentReference |
getDocumentReference()
|
AttachmentReference |
replaceParent(EntityReference oldParent,
EntityReference newParent)
Return a clone of this reference, but with one of its parent replaced by another one. |
protected void |
setParent(EntityReference parent)
Entity reference are immutable since 3.3M2, so this method is now protected. |
protected void |
setType(EntityType type)
Entity reference are immutable since 3.3M2, so this method is now protected. |
| Methods inherited from class org.xwiki.model.reference.EntityReference |
|---|
appendParent, compareTo, equals, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, setName, setParameter, setParameters, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AttachmentReference(EntityReference reference)
AttachmentReference. It checks the
validity of the passed reference (ie correct type and correct parent).
reference - the reference to be transformed
IllegalArgumentException - if the passed reference is not a valid attachment reference
protected AttachmentReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
reference - the reference that is clonedoldReference - the old parent that will be replacednewReference - the new parent that will replace oldReference in the chain
public AttachmentReference(String fileName,
DocumentReference parent)
fileName - the name of the attachmentparent - the reference of the document| Method Detail |
|---|
protected void setParent(EntityReference parent)
setParent in class EntityReferenceparent - the parent for this entity, may be null for a root entity.
IllegalArgumentException - if the passed parent is not a valid attachment reference parent (ie an
attachment reference)protected void setType(EntityType type)
setType in class EntityReferencetype - the type for this entity
IllegalArgumentException - if the passed type is not an attachment typepublic DocumentReference getDocumentReference()
public AttachmentReference replaceParent(EntityReference oldParent,
EntityReference newParent)
EntityReference
replaceParent in class EntityReferenceoldParent - the old parent that will be replacednewParent - the new parent that will replace oldParent in the chain
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||