|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.print.DefaultAttributeHandler
public class DefaultAttributeHandler
Name: DefaultAttributeParser
Description: Default AttributeHandler implementation.
Field Summary | |
---|---|
TypedAttributeHandler |
booleanHandler
The boolean attribute handler. |
TypedAttributeHandler |
borderHandler
The boolean attribute handler. |
TypedAttributeHandler |
colorHandler
The color attribute handler. |
TypedAttributeHandler |
dimensionHandler
The integer attribute handler. |
TypedAttributeHandler |
doubleHandler
The double attribute handler. |
TypedAttributeHandler |
floatHandler
The integer attribute handler. |
TypedAttributeHandler |
horizontalAlignmentHandler
The horizontal alignment attribute handler. |
TypedAttributeHandler |
verticalAlignmentHandler
The vertical alignment attribute handler. |
Constructor Summary | |
---|---|
DefaultAttributeHandler()
Constructs a DefaultAttributeHandler instance with no specific attributes. |
Method Summary | |
---|---|
TypedAttributeHandler |
getBooleanHandler()
Gets the boolean attribute handler. |
TypedAttributeHandler |
getBorderHandler()
Gets the boolean attribute handler. |
TypedAttributeHandler |
getColorHandler()
Gets the color attribute handler. |
TypedAttributeHandler |
getDimensionHandler()
Gets the dimension attribute handler. |
TypedAttributeHandler |
getDoubleHandler()
Gets the double attribute handler. |
TypedAttributeHandler |
getEscapeSequenceTextHandler()
Gets the integer attribute handler. |
TypedAttributeHandler |
getFloatHandler()
Gets the float attribute handler. |
TypedAttributeHandler |
getHorizontalAlignmentHandler()
Gets the horizontal alignment attribute handler. |
TypedAttributeHandler |
getIntegerHandler()
Gets the integer attribute handler. |
TypedAttributeHandler |
getTextHandler()
Gets the integer attribute handler. |
TypedAttributeHandler |
getVerticalAlignmentHandler()
Gets the vertical alignment attribute handler. |
boolean |
parseBooleanAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Gets the boolean value for the given attribute's name. |
int |
parseBorderAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses the border value from the given attribute. |
Color |
parseColorAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses the color value from the given attribute. |
float |
parseDimensionAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses a dimension value from the given string. |
double |
parseDoubleAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses a double value from the given string. |
float |
parseFloatAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses a float value from the given string. |
int |
parseHorizontalAlignmentAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses the horizontal alignment value from the given attribute. |
int |
parseIntAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses an integer value from the given string. |
String |
parseTextAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate,
boolean translateEscapeSequences)
Gets the value for the given attribute's name. |
int |
parseVerticalAlignmentAttribute(Locator locator,
String attrName,
Object attrValue,
boolean evaluate)
Parses the vertical alignment value from the given attribute. |
protected void |
processEscapeSequences(Locator locator,
String attrName,
String contents,
StringBuffer buffer,
boolean trimHead)
Processes the escape sequences from the given content string and writes the result into the given buffer. |
void |
setDocumentHandler(DocumentHandler documentHandler)
Sets the document handler. |
Object |
typeCastAttributeValue(Locator locator,
AttributeDefinition attrDef,
String attrName,
Object value)
Casts the given object value into a the correct type for the specified attribute definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public TypedAttributeHandler floatHandler
public TypedAttributeHandler dimensionHandler
public TypedAttributeHandler doubleHandler
public TypedAttributeHandler booleanHandler
public TypedAttributeHandler colorHandler
public TypedAttributeHandler borderHandler
public TypedAttributeHandler horizontalAlignmentHandler
public TypedAttributeHandler verticalAlignmentHandler
Constructor Detail |
---|
public DefaultAttributeHandler()
Method Detail |
---|
public void setDocumentHandler(DocumentHandler documentHandler)
setDocumentHandler
in interface AttributeHandler
documentHandler
- The document handler to set.public Object typeCastAttributeValue(Locator locator, AttributeDefinition attrDef, String attrName, Object value) throws DocumentHandlerException
typeCastAttributeValue
in interface AttributeHandler
locator
- The source locator.attrDef
- The attribute definition.attrName
- The attribute name.value
- The value to convert.
DocumentHandlerException
- In case the type conversion failed.public String parseTextAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate, boolean translateEscapeSequences) throws TagAttributeException
getStringAttribute(java.lang.String, java.lang.String, boolean)
but takes care of escape sequences.
parseTextAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.translateEscapeSequences
- Tells whether or not to translate escape sequences.
TagAttributeException
- if the item contains an invalid value or an required attribute
was not defined.public int parseIntAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseIntAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public float parseFloatAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseFloatAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public float parseDimensionAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseDimensionAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public double parseDoubleAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseDoubleAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public boolean parseBooleanAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseBooleanAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The attribute's name.attrValue
- The argument value.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- if the item contains an invalid value or an required attribute
was not defined.public Color parseColorAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseColorAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The name of the attribute to parse.attrValue
- The attribute value to parse.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public int parseBorderAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseBorderAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The name of the attribute to parse.attrValue
- The attribute value to parse.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public int parseHorizontalAlignmentAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseHorizontalAlignmentAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The name of the attribute to parse.attrValue
- The attribute value to parse.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.public int parseVerticalAlignmentAttribute(Locator locator, String attrName, Object attrValue, boolean evaluate) throws TagAttributeException
parseVerticalAlignmentAttribute
in interface AttributeHandler
locator
- The tag source locator.attrName
- The name of the attribute to parse.attrValue
- The attribute value to parse.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- Thrown in case the item contained an invalid value.protected void processEscapeSequences(Locator locator, String attrName, String contents, StringBuffer buffer, boolean trimHead) throws DocumentHandlerException
locator
- The tag source locator.attrName
- The attribute name.contents
- The contents to parse for escape sequencesbuffer
- The buffer to write to.trimHead
- Tells whether or not to trim the leading white spaces
DocumentHandlerException
public TypedAttributeHandler getTextHandler()
getTextHandler
in interface AttributeHandler
public TypedAttributeHandler getEscapeSequenceTextHandler()
getEscapeSequenceTextHandler
in interface AttributeHandler
public TypedAttributeHandler getIntegerHandler()
getIntegerHandler
in interface AttributeHandler
public TypedAttributeHandler getFloatHandler()
getFloatHandler
in interface AttributeHandler
public TypedAttributeHandler getDimensionHandler()
getDimensionHandler
in interface AttributeHandler
public TypedAttributeHandler getDoubleHandler()
getDoubleHandler
in interface AttributeHandler
public TypedAttributeHandler getBooleanHandler()
getBooleanHandler
in interface AttributeHandler
public TypedAttributeHandler getColorHandler()
getColorHandler
in interface AttributeHandler
public TypedAttributeHandler getBorderHandler()
getBorderHandler
in interface AttributeHandler
public TypedAttributeHandler getHorizontalAlignmentHandler()
getHorizontalAlignmentHandler
in interface AttributeHandler
public TypedAttributeHandler getVerticalAlignmentHandler()
getVerticalAlignmentHandler
in interface AttributeHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |