- java.lang.Object
-
- com.itextpdf.text.xml.XmlPeer
-
- Direct Known Subclasses:
HtmlPeer
public class XmlPeer extends java.lang.ObjectThis interface is implemented by the peer of all the iText objects.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.PropertiesattributeAliasesThis is the Map that contains the aliases of the attributes.protected java.util.PropertiesattributeValuesThis is the Map that contains the default values of the attributes.protected java.lang.StringcustomTagnameThis is the name of the alias.protected java.lang.StringdefaultContentThis is String that contains the default content of the attributes.protected java.lang.StringtagnameThis is the name of the alias.
-
Constructor Summary
Constructors Constructor Description XmlPeer(java.lang.String name, java.lang.String alias)Creates a XmlPeer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlias(java.lang.String name, java.lang.String alias)Sets an alias for an attribute.voidaddValue(java.lang.String name, java.lang.String value)Sets a value for an attribute.java.lang.StringgetAlias()Gets the tagname of the peer.java.util.PropertiesgetAttributes(org.xml.sax.Attributes attrs)Gets the list of attributes of the peer.java.util.PropertiesgetDefaultValues()Returns the default values.java.lang.StringgetName(java.lang.String name)Returns the iText attribute name.java.lang.StringgetTag()Gets the tagname of the peer.voidsetContent(java.lang.String content)Sets the default content.
-
-
-
Field Detail
-
tagname
protected java.lang.String tagname
This is the name of the alias.
-
customTagname
protected java.lang.String customTagname
This is the name of the alias.
-
attributeAliases
protected java.util.Properties attributeAliases
This is the Map that contains the aliases of the attributes.
-
attributeValues
protected java.util.Properties attributeValues
This is the Map that contains the default values of the attributes.
-
defaultContent
protected java.lang.String defaultContent
This is String that contains the default content of the attributes.
-
-
Method Detail
-
getTag
public java.lang.String getTag()
Gets the tagname of the peer.- Returns:
- the iText name of a tag
-
getAlias
public java.lang.String getAlias()
Gets the tagname of the peer.- Returns:
- the user defined tagname
-
getAttributes
public java.util.Properties getAttributes(org.xml.sax.Attributes attrs)
Gets the list of attributes of the peer.- Parameters:
attrs- the user defined set of attributes- Returns:
- the set of attributes translated to iText attributes
-
addAlias
public void addAlias(java.lang.String name, java.lang.String alias)Sets an alias for an attribute.- Parameters:
name- the iText tagnamealias- the custom tagname
-
addValue
public void addValue(java.lang.String name, java.lang.String value)Sets a value for an attribute.- Parameters:
name- the iText tagnamevalue- the default value for this tag
-
setContent
public void setContent(java.lang.String content)
Sets the default content.- Parameters:
content- the default content
-
getName
public java.lang.String getName(java.lang.String name)
Returns the iText attribute name.- Parameters:
name- the custom attribute name- Returns:
- iText translated attribute name
-
getDefaultValues
public java.util.Properties getDefaultValues()
Returns the default values.- Returns:
- A set of default (user defined) values
-
-