| Modifier and Type | Class and Description |
|---|---|
static class |
Part.GetTarget
Options when getting a target which does not exists yet.
|
| Constructor and Description |
|---|
Part(Part original)
Copy constructor.
|
Part(Store store)
Creates a new part with an empty source.
|
Part(Store store,
java.lang.String sourceContent)
Creates a new part with a given plain text source.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getId()
Gets the id for this part.
|
java.lang.String |
getId(boolean createIfNeeded)
Gets the id for this part.
|
boolean |
getPreserveWS()
Indicates if the whitespace of this part's content must be preserved.
|
Fragment |
getSource()
Gets the source fragment for this part.
|
Tags |
getSourceTags()
Gets all the source tags for the unit where this part is.
|
Store |
getStore()
Gets the store for this part.
|
Fragment |
getTarget()
Gets the target fragment for this part.
|
Fragment |
getTarget(Part.GetTarget creationOption)
Gets the target fragment for this part, and possibly create it if it does not exists yet.
|
int |
getTargetOrder()
Gets the target order for this part.
|
Tags |
getTargetTags()
Gets all the target tags for the unit where this part is.
|
boolean |
hasTarget()
Indicates if this part has a target.
|
boolean |
isSegment()
Indicates if this part is a segment or an ignorable.
|
void |
removeMarkers(boolean target,
java.lang.String type)
Removes the markers in the source or target content of this part.
|
void |
setId(java.lang.String id)
Sets the id for this part.
|
void |
setPreserveWS(boolean preserveWS)
Sets the flag indicating if the whitespace of this part's content must be preserved.
|
Fragment |
setSource(Fragment fragment)
Sets the fragment of the source for this part.
|
Fragment |
setSource(java.lang.String plainText)
Sets the source for this part as a new fragment made of a plain text string.
|
Fragment |
setTarget(Fragment fragment)
Sets the fragment of the target for this part.
|
Fragment |
setTarget(java.lang.String plainText)
Sets the target for this part as a new fragment made of a plain text string.
|
void |
setTargetOrder(int targetOrder)
Sets the target order value for this part.
|
void |
showProtectedContent()
Expands all
PCont references in this part into normal content. |
public Part(Part original)
original - the original part to duplicate.public Part(Store store)
store - the store associated with the new part (cannot be null).public Part(Store store, java.lang.String sourceContent)
store - the store associated with the new part (cannot be null).sourceContent - the plain text source content of the new part.public java.lang.String getId()
public java.lang.String getId(boolean createIfNeeded)
createIfNeeded - true to assign automatically an id if none is already set,
false to get null if there is no id set.public void setId(java.lang.String id)
id - the new id for this part (can be null).
No check is done for uniqueness.public boolean getPreserveWS()
public void setPreserveWS(boolean preserveWS)
preserveWS - true to preserve the whitespace, false otherwise.public Fragment getSource()
public Fragment setSource(Fragment fragment)
fragment - the fragment to set.public Fragment setSource(java.lang.String plainText)
plainText - the plain text source content to set.public boolean hasTarget()
public Fragment getTarget(Part.GetTarget creationOption)
creationOption - action to take if no target exists yet for this part.getTarget()public Fragment getTarget()
getTarget(GetTarget) to create the fragment if needed.getTarget(GetTarget)public Fragment setTarget(Fragment fragment)
fragment - the fragment to set.public Fragment setTarget(java.lang.String plainText)
plainText - the plain text target content to set.public Tags getSourceTags()
public Tags getTargetTags()
public void setTargetOrder(int targetOrder)
targetOrder - the new target order for this part.public int getTargetOrder()
public Store getStore()
public boolean isSegment()
public void removeMarkers(boolean target,
java.lang.String type)
target - true to remove from the target, false to remove from the source.type - the type of markers to remove (or null to remove all markers).public void showProtectedContent()
PCont references in this part into normal content.
This is done on both source and target.