|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.util.entity.AbstractNamedEntity
org.torweg.pulse.util.entity.AbstractNamableEntity
org.torweg.pulse.site.content.Variant<T>
T - the actual Variant-implementation@Entity public abstract class Variant<T extends Variant<?>>
An abstract base class for Variants.
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
LOGGER
The Logger of the Variant. |
| Constructor Summary | |
|---|---|
Variant()
|
|
| Method Summary | |
|---|---|
boolean |
addVariant(T variant)
Adds a sub- Variant to the Variant. |
int |
compareTo(T pVariant)
Compares two Variants
lexicographically. |
abstract T |
createCopy(Content content)
Creates a non-persistent (therefore id = null) copy of the current Variant. |
boolean |
equals(java.lang.Object pObject)
Determines whether the given Object is equal to the Variant. |
java.util.Set<VirtualFile> |
getAssociatedVirtualFiles()
Returns the VirtualFiles of the Variant. |
java.util.Set<Attachment> |
getAttachments()
Returns the Attachments of the Variant. |
abstract Content |
getContent()
Returns the Content the Variant belongs to. |
abstract java.lang.StringBuilder |
getFullTextValue()
Returns the StringBuilder to be indexed for full text searches. |
T |
getParentVariant()
Returns the parent- AbstractBasicVariant of the AbstractBasicVariant . |
java.util.Set<T> |
getVariants()
Returns the sub- Variants of the Variant. |
int |
hashCode()
Returns a hash code for the Variant. |
abstract void |
onVirtualFileSystemChange(VirtualFile file)
Is called by the VirtualFileSystem, if any of the associated
VirtualFiles has been moved in the file system. |
protected static void |
processHTML(org.jdom.Element html,
java.util.Set<VirtualFile> files, VirtualFileSystem vfs)
Searches the given Element for VirtualFiles, adds them to
the given Set of VirtualFiles and adds a vfs-id
attribute to the corresponding Element. |
boolean |
removeVariant(T variant)
Removes the given Variant from the Variant. |
void |
setAssociatedVirtualFiles(java.util.Set<VirtualFile> pVirtualFiles)
Sets the VirtualFiles of the Variant. |
void |
setAttachments(java.util.Set<Attachment> pAttachments)
Sets the Attachments of the Variant. |
protected abstract void |
setContent(Content content)
Sets the Content the Variant belongs to. |
void |
setVariants(java.util.Set<T> vars)
Sets the Variants of the Variant. |
protected static org.jdom.Element |
updateHTML(org.jdom.Element html, VirtualFile file)
Updates the src and href attributes in the given Element, referencing VirtualFiles by a vfs-id attribute. |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity |
|---|
setName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity |
|---|
getName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, getFullQualifiedClassNameJAXB, getId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.torweg.pulse.site.content.util.ILinkCorretable |
|---|
getLinkCorrectables |
| Methods inherited from interface org.torweg.pulse.bundle.ExtendedJDOMable |
|---|
deserializeToJDOM |
| Methods inherited from interface org.torweg.pulse.bundle.JDOMable |
|---|
deserializeToJDOM |
| Methods inherited from interface org.torweg.pulse.util.INamed |
|---|
getName |
| Field Detail |
|---|
protected static final org.slf4j.Logger LOGGER
Logger of the Variant.
| Constructor Detail |
|---|
public Variant()
| Method Detail |
|---|
public final java.util.Set<T> getVariants()
Variants of the Variant.
getVariants in interface IHasVariantsVariants of the Variantpublic final void setVariants(java.util.Set<T> vars)
Variants of the Variant.
vars - the Variants to be set. (final)public final boolean addVariant(T variant)
Variant to the Variant.
variant - the Content to be added
true if and only if the given Variant has been
added to the internal List<Variant>, false
otherwisepublic final boolean removeVariant(T variant)
Variant from the Variant.
variant - the Variant to be removed
true if and only if the given Variant has been
removed from the internal List<Variant>, false otherwisepublic final T getParentVariant()
AbstractBasicVariant of the AbstractBasicVariant .
AbstractBasicVariant of the AbstractBasicVariantpublic final java.util.Set<VirtualFile> getAssociatedVirtualFiles()
VirtualFiles of the Variant.
VirtualFiles of the Variant. (reference)public final void setAssociatedVirtualFiles(java.util.Set<VirtualFile> pVirtualFiles)
VirtualFiles of the Variant.
pVirtualFiles - the VirtualFiles to be set. (overwrite matching)public final java.util.Set<Attachment> getAttachments()
Attachments of the Variant.
Attachments of the Variant. (reference)public final void setAttachments(java.util.Set<Attachment> pAttachments)
Attachments of the Variant.
pAttachments - the Attachments to be set. (overwrite matching)public final boolean equals(java.lang.Object pObject)
Object is equal to the Variant.
equals in class AbstractBasicEntitypObject - the Object to be checked for equality with the Variant.
true, if the given Object is equal to the Variant. Returns false, otherwise.public final int hashCode()
Variant.
hashCode in class AbstractBasicEntityVariant.AbstractBasicEntity.hashCode()public final int compareTo(T pVariant)
Variants
lexicographically. Note: See the details below for
a full explanation.
First, the names are compared lexicographically, using the result of
getName().compareTo(pVariant.getName()). If the Variants'
names are lexicographically equal, their ids are compared
afterwards. If any of the two ids is null, the comparison
scheme of BasicObject is used.
compareTo in interface java.lang.Comparable<T extends Variant<?>>pVariant - the Variant used for the comparison.
Variant is less than, equal to, or
greater than the given Variant.public abstract java.lang.StringBuilder getFullTextValue()
StringBuilder to be indexed for full text searches.
StringBuilder to be indexed for full text searches.public abstract void onVirtualFileSystemChange(VirtualFile file)
VirtualFileSystem, if any of the associated
VirtualFiles has been moved in the file system.
file - the associated VirtualFile that has been moved in the
file system.
public abstract T createCopy(Content content)
throws java.lang.UnsupportedOperationException
Variant.
content - the parent Content
Variant.
java.lang.UnsupportedOperationException - if the method is not supported.public abstract Content getContent()
Content the Variant belongs to.
Contentprotected abstract void setContent(Content content)
Content the Variant belongs to.
content - Content
protected static final void processHTML(org.jdom.Element html,
java.util.Set<VirtualFile> files, VirtualFileSystem vfs)
Element for VirtualFiles, adds them to
the given Set of VirtualFiles and adds a vfs-id
attribute to the corresponding Element.
html - the Element to be searched.files - the Set of VirtualFiles.vfs - an instance of the VirtualFileSystem.protected static final org.jdom.Element updateHTML(org.jdom.Element html, VirtualFile file)
src and href attributes in the given Element, referencing VirtualFiles by a vfs-id attribute.
html - the Element to be updated.file - the VirtualFile that has been changed.
Element.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||