com.itextpdf.text.html.simpleparser
Class ChainedProperties

java.lang.Object
  extended by com.itextpdf.text.html.simpleparser.ChainedProperties

public class ChainedProperties
extends java.lang.Object

Stores the hierarchy of tags along with the attributes of each tag.

Since:
5.0.6 renamed from ChainedProperties

Field Summary
 java.util.List<com.itextpdf.text.html.simpleparser.ChainedProperties.TagAttributes> chain
          A list of chained properties representing the tag hierarchy.
 
Constructor Summary
ChainedProperties()
          Creates a new instance of ChainedProperties
 
Method Summary
 void addToChain(java.lang.String tag, java.util.Map<java.lang.String,java.lang.String> props)
          Adds a tag and its corresponding properties to the chain.
protected  void adjustFontSize(java.util.Map<java.lang.String,java.lang.String> attrs)
          If the properties contain a font size, the size may need to be adjusted based on font sizes higher in the hierarchy.
 java.lang.String getProperty(java.lang.String key)
          Walks through the hierarchy (bottom-up) looking for a property key.
 boolean hasProperty(java.lang.String key)
          Walks through the hierarchy (bottom-up) looking for a property key.
 void removeChain(java.lang.String tag)
          Walks through the hierarchy (bottom-up) and removes the first occurrence of a tag that is encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chain

public java.util.List<com.itextpdf.text.html.simpleparser.ChainedProperties.TagAttributes> chain
A list of chained properties representing the tag hierarchy.

Constructor Detail

ChainedProperties

public ChainedProperties()
Creates a new instance of ChainedProperties

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
Walks through the hierarchy (bottom-up) looking for a property key. Returns a value as soon as a match is found or null if the key can't be found.

Parameters:
key - the key of the property
Returns:
the value of the property

hasProperty

public boolean hasProperty(java.lang.String key)
Walks through the hierarchy (bottom-up) looking for a property key. Returns true as soon as a match is found or false if the key can't be found.

Parameters:
key - the key of the property
Returns:
true if the key is found

addToChain

public void addToChain(java.lang.String tag,
                       java.util.Map<java.lang.String,java.lang.String> props)
Adds a tag and its corresponding properties to the chain.

Parameters:
tag - the tags that needs to be added to the chain
props - the tag's attributes

removeChain

public void removeChain(java.lang.String tag)
Walks through the hierarchy (bottom-up) and removes the first occurrence of a tag that is encountered.

Parameters:
tag - the tag that needs to be removed

adjustFontSize

protected void adjustFontSize(java.util.Map<java.lang.String,java.lang.String> attrs)
If the properties contain a font size, the size may need to be adjusted based on font sizes higher in the hierarchy.

Parameters:
attrs - the attributes that may have to be updated
Since:
5.0.6 (renamed)


Copyright © 2013. All Rights Reserved.