|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.biltmore.tools.odttoapt.maven.plugin.models.APT
public abstract class APT
This is a base class for all APT models.
Field Summary | |
---|---|
private boolean |
allowFormat
Determines if the APT object is allowed to be formatted. |
private boolean |
link
If link is set to true parsed XML elements resulting in multiple consecutive identical APT objects are linked togheter into one. |
private APTParent |
parent
If this object is added to a parent, this will contain that parent. |
private String |
value
A possible value for this APT object. |
Constructor Summary | |
---|---|
protected |
APT()
Creates a new ATP subclass instance since this class is abstract. |
Method Summary | |
---|---|
void |
done()
This is called when the object is done. |
protected String |
formatText(String text,
String indent,
int width)
Formats a string of text splitting it into several lines breaking at a specified width and prefixing with a specified indent. |
protected APTParent |
getParent()
Returns the parent of this object if any or null otherwise. |
protected String |
getUnformattedValue()
This should always returns the unformatted value as it is stored. |
protected String |
getValue()
Returns the value or null if not set. |
protected boolean |
hasValue()
Returns true if there is a value available. |
boolean |
isAllowFormat()
Returns true if this APT object is allowed to be formatted. |
boolean |
isLink()
Returns true if this should be linked with previous consecutive identical. |
protected void |
setAllowFormat(boolean allowFormat)
Sets if formatting is allowed. |
protected void |
setLink(boolean link)
Sets if multiple consecutive identical APT objects should be linked. |
void |
setParent(APTParent parent)
Sets the parent of this object. |
void |
setValue(String value)
Sets the value for this APT. |
String |
toString()
Returns a String representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String value
private boolean allowFormat
private boolean link
private APTParent parent
Constructor Detail |
---|
protected APT()
Method Detail |
---|
protected void setAllowFormat(boolean allowFormat)
allowFormat
- true or false.public boolean isAllowFormat()
protected void setLink(boolean link)
link
- true or false.public boolean isLink()
public void setParent(APTParent parent)
parent
- The parent to set.protected APTParent getParent()
public void setValue(String value)
Please note that this gets called every time the SAXParser calls characters(...) in OdtSAXHandler. Depending on the element text this sometimes gets called more than once before the element content is complete. Entity references are usually received in a separate call for example. Therefore we append each set value. That means calling this with a value and then again with another value will not replace the first value, but append to it.
Values should never ever be stored formatted in this object!! The only place were formatting should occur is in getValue().
value
- The value to set.protected String getValue()
protected String getUnformattedValue()
protected boolean hasValue()
public void done()
protected String formatText(String text, String indent, int width)
This method shamelessly stolen from OptionsManager (http://optionsmanager.sf.net), but that is ok since it is also made by me, and also open source.
text
- The text to format.indent
- The indent to use.width
- The width to break at.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |