public class GenericSkeleton extends Object implements ISkeleton
| Constructor and Description |
|---|
GenericSkeleton()
Creates a new empty GenericSkeleton object.
|
GenericSkeleton(GenericSkeleton skel)
Creates a new GenericSkeleton object and initialize it with the parts
of an existing one passed as a parameter.
|
GenericSkeleton(String data)
Creates a new GenericSkeleton object and append some data to it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(char data)
Adds a new part to this skeleton, and set a character data to it.
|
void |
add(GenericSkeleton skel)
Adds to this skeleton all the parts of a given skeleton.
|
void |
add(String data)
Adds a new part to this skeleton, and set a string data to it.
|
void |
addContentPlaceholder(ITextUnit textUnit)
Adds to this skeleton a placeholder for the source content of the resource
to which this skeleton is attached.
|
void |
addContentPlaceholder(ITextUnit textUnit,
LocaleId locId)
Adds to this skeleton a placeholder for the content (in a given locale) of the resource
to which this skeleton is attached.
|
void |
addReference(IReferenceable referent)
Adds to this skeleton a reference to an existing resource send before the one to
which this skeleton is attached to.
|
GenericSkeletonPart |
addValuePlaceholder(INameable referent,
String propName,
LocaleId locId)
Adds to this skeleton a place-holder for the value of a property (in a given locale)
of the resource to which this skeleton is attached.
|
void |
append(char data)
Appends a character data to this skeleton.
|
void |
append(String data)
Appends a string of data to this skeleton.
|
void |
appendToFirstPart(String data)
Appends a string of data to the first skeleton part, a new
part is created is none exists already.
|
void |
attachParent(INameable parent)
Attaches a parent resource to a skeleton part.
|
void |
changeSelfReferents(INameable newReferent)
Updates all the self-references to use the given referent.
|
GenericSkeleton |
clone()
Clones this GenericSkeleton object.
|
protected void |
copyFields(GenericSkeleton toSkel) |
void |
flushPart()
Forces the current part to be completed, so the next call to append data will start a new part.
|
GenericSkeletonPart |
getFirstPart()
Gets the first part of this skeleton, or null if there are none.
|
GenericSkeletonPart |
getLastPart()
Gets the last part of this skeleton, or null if there are none.
|
IResource |
getParent()
Gets the parent resource of this skeleton.
|
List<GenericSkeletonPart> |
getParts()
Gets a list of all the parts of this skeleton.
|
boolean |
isEmpty()
Indicates if this skeleton is empty or not.
|
boolean |
isEmpty(boolean ignoreWhitespaces)
Indicates if this skeleton is empty or not, considering the white-spaces
or not.
|
void |
setParent(IResource parent)
Sets a parent of this skeleton object.
|
protected void |
setParts(ArrayList<GenericSkeletonPart> list) |
String |
toString()
Gets a string representation of the content of all the part of the skeleton.
|
public GenericSkeleton()
public GenericSkeleton(String data)
data - the data to append.public GenericSkeleton(GenericSkeleton skel)
skel - the existing skeleton from which to copy the parts.public boolean isEmpty()
public boolean isEmpty(boolean ignoreWhitespaces)
ignoreWhitespaces - true to ignore the white-spaces.public void add(String data)
data - the data to add.public void flushPart()
public void add(char data)
data - the data to add.public void add(GenericSkeleton skel)
skel - the existing skeleton from which to copy the parts.public void appendToFirstPart(String data)
data - the string data to append.public void append(String data)
data - the string data to append.public void append(char data)
data - the character data to append.public void addContentPlaceholder(ITextUnit textUnit)
textUnit - the resource object.public void addContentPlaceholder(ITextUnit textUnit, LocaleId locId)
textUnit - the resource object.locId - the locale; use null if the reference is the source.public GenericSkeletonPart addValuePlaceholder(INameable referent, String propName, LocaleId locId)
referent - the resource object.propName - the property name.locId - the locale; use null for the source; LocaleId.EMPTY for resource-level property.public void changeSelfReferents(INameable newReferent)
newReferent - the new referent to use.public void addReference(IReferenceable referent)
referent - the resource to refer to.public void setParent(IResource parent)
ISkeletonpublic void attachParent(INameable parent)
parent - the parent resource to attach.public List<GenericSkeletonPart> getParts()
protected void setParts(ArrayList<GenericSkeletonPart> list)
public String toString()
public GenericSkeletonPart getLastPart()
public GenericSkeletonPart getFirstPart()
protected void copyFields(GenericSkeleton toSkel)
public GenericSkeleton clone()
Copyright © 2021. All rights reserved.