public class AttachmentReference extends EntityReference
TOSTRING_SERIALIZER| Modifier | Constructor and Description |
|---|---|
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameter, setParameters, size, toStringpublic AttachmentReference(EntityReference reference)
AttachmentReference. It checks the
validity of the passed reference (ie correct type and correct parent).reference - the reference to be transformedIllegalArgumentException - if the passed reference is not a valid attachment referenceprotected 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 chainpublic AttachmentReference(String fileName, DocumentReference parent)
fileName - the name of the attachmentparent - the reference of the documentprotected 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 entityIllegalArgumentException - if the passed type is not an attachment typepublic DocumentReference getDocumentReference()
public AttachmentReference replaceParent(EntityReference oldParent, EntityReference newParent)
EntityReferencereplaceParent in class EntityReferenceoldParent - the old parent that will be replacednewParent - the new parent that will replace oldParent in the chain. If the same as oldParent, this is
returned.Copyright © 2004–2018 XWiki. All rights reserved.