@Unstable public class PageAttachmentReference extends EntityReference
TOSTRING_SERIALIZER| Modifier | Constructor and Description |
|---|---|
|
PageAttachmentReference(EntityReference reference)
Special constructor that transforms a generic entity reference into an
PageAttachmentReference. |
|
PageAttachmentReference(EntityReference reference,
EntityReference parent)
Clone an PageAttachmentReference, but use the specified parent for its new parent.
|
protected |
PageAttachmentReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone an AttachmentReference, but replace one of the parent in the chain by a new one.
|
|
PageAttachmentReference(String fileName,
PageReference parent)
Create a new attachment reference based on the attachment name and the parent page reference.
|
| Modifier and Type | Method and Description |
|---|---|
PageReference |
getPageReference() |
PageAttachmentReference |
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.
|
PageAttachmentReference |
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 PageAttachmentReference(EntityReference reference)
PageAttachmentReference. 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 PageAttachmentReference(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 PageAttachmentReference(String fileName, PageReference parent)
fileName - the name of the attachmentparent - the reference of the pagepublic PageAttachmentReference(EntityReference reference, EntityReference parent)
reference - the reference to cloneparent - the new parent to useprotected 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)
Overridden in order to verify the validity of the passed type.
setType in class EntityReferencetype - the type for this entityIllegalArgumentException - if the passed type is not an attachment typepublic PageReference getPageReference()
public PageAttachmentReference 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.public PageAttachmentReference replaceParent(EntityReference newParent)
EntityReferencereplaceParent in class EntityReferencenewParent - the new parent that will replace the parentCopyright © 2004–2018 XWiki. All rights reserved.