Class RtfAttributes
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
FOPRtfAttributes
public class RtfAttributes extends java.lang.Object implements java.lang.Cloneable
Attributes for RtfText.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap
values
private org.xml.sax.Attributes
xslAttributes
-
Constructor Summary
Constructors Constructor Description RtfAttributes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIntegerValue(int addValue, java.lang.String name)
Add integer valueaddValue
to attribute with namename
.java.lang.Object
clone()
java.lang.Object
getValue(java.lang.String name)
java.lang.Integer
getValueAsInteger(java.lang.String name)
Returns a value as an Integer.org.xml.sax.Attributes
getXslAttributes()
Added by Normand Masse Used for attribute inheritanceboolean
isSet(java.lang.String name)
java.util.Iterator
nameIterator()
RtfAttributes
set(java.lang.String name)
set an attribute that has no value.RtfAttributes
set(java.lang.String name, int value)
Set an attribute that has an integer valueRtfAttributes
set(java.lang.String name, java.lang.String type)
Set an attribute that has a String valueRtfAttributes
set(java.lang.String name, RtfAttributes value)
Set an attribute that has nested attributes as valueRtfAttributes
set(RtfAttributes attrs)
Set attributes from another attributes objectvoid
setXslAttributes(org.xml.sax.Attributes pAttribs)
Added by Normand Masse Used for attribute inheritancejava.lang.String
toString()
debugging logRtfAttributes
unset(java.lang.String name)
unset an attribute that has no value
-
-
-
Method Detail
-
set
public RtfAttributes set(RtfAttributes attrs)
Set attributes from another attributes object- Parameters:
attrs
- RtfAttributes object whose elements will be copied into this instance- Returns:
- this object, for chaining calls
-
set
public RtfAttributes set(java.lang.String name)
set an attribute that has no value.- Parameters:
name
- name of attribute to set- Returns:
- this object, for chaining calls
-
unset
public RtfAttributes unset(java.lang.String name)
unset an attribute that has no value- Parameters:
name
- name of attribute to unset- Returns:
- this object, for chaining calls
-
toString
public java.lang.String toString()
debugging log- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
set
public RtfAttributes set(java.lang.String name, int value)
Set an attribute that has an integer value- Parameters:
name
- name of attributevalue
- value of attribute- Returns:
- this (which now contains the new entry), for chaining calls
-
set
public RtfAttributes set(java.lang.String name, java.lang.String type)
Set an attribute that has a String value- Parameters:
name
- name of attributetype
- value of attribute- Returns:
- this (which now contains the new entry)
-
set
public RtfAttributes set(java.lang.String name, RtfAttributes value)
Set an attribute that has nested attributes as value- Parameters:
name
- name of attributevalue
- value of the nested attributes- Returns:
- this (which now contains the new entry)
-
getValue
public java.lang.Object getValue(java.lang.String name)
- Parameters:
name
- String containing attribute name- Returns:
- the value of an attribute, null if not found
-
getValueAsInteger
public java.lang.Integer getValueAsInteger(java.lang.String name)
Returns a value as an Integer. The value is simply cast to an Integer.- Parameters:
name
- String containing attribute name- Returns:
- the value of an attribute, null if not found
-
isSet
public boolean isSet(java.lang.String name)
- Parameters:
name
- String containing attribute name- Returns:
- true if given attribute is set
-
nameIterator
public java.util.Iterator nameIterator()
- Returns:
- an Iterator on all names that are set
-
getXslAttributes
public org.xml.sax.Attributes getXslAttributes()
Added by Normand Masse Used for attribute inheritance- Returns:
- Attributes
-
setXslAttributes
public void setXslAttributes(org.xml.sax.Attributes pAttribs)
Added by Normand Masse Used for attribute inheritance- Parameters:
pAttribs
- attributes
-
addIntegerValue
public void addIntegerValue(int addValue, java.lang.String name)
Add integer valueaddValue
to attribute with namename
. If there is no such setted attribute, then value of this attribure is equal toaddValue
.- Parameters:
addValue
- the increment of valuename
- the name of attribute
-
-