org.htmlcleaner
Class TagTransformation

java.lang.Object
  extended by org.htmlcleaner.TagTransformation

public class TagTransformation
extends Object

Describes how specified tag is transformed to another one, or is ignored during parsing


Constructor Summary
TagTransformation(String sourceTag)
          Creates new tag transformation in which specified tag will be skipped (ignored) during parsing process.
TagTransformation(String sourceTag, String destTag)
          Creates new tag transformation from source tag to target tag preserving all source tag attributes.
TagTransformation(String sourceTag, String destTag, boolean preserveSourceAttributes)
          Creates new tag transformation from source tag to target tag specifying whether source tag attributes are preserved.
 
Method Summary
 void addAttributeTransformation(String targetAttName)
          Adds new attribute transformation in which destination attrbute will not exists (simply removes it from list of attributes).
 void addAttributeTransformation(String targetAttName, String transformationDesc)
          Adds new attribute transformation to this tag transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagTransformation

public TagTransformation(String sourceTag,
                         String destTag,
                         boolean preserveSourceAttributes)
Creates new tag transformation from source tag to target tag specifying whether source tag attributes are preserved.

Parameters:
sourceTag - Name of the tag to be transformed.
destTag - Name of tag to which source tag is to be transformed.
preserveSourceAttributes - Tells whether source tag attributes are preserved in transformation.

TagTransformation

public TagTransformation(String sourceTag,
                         String destTag)
Creates new tag transformation from source tag to target tag preserving all source tag attributes.

Parameters:
sourceTag - Name of the tag to be transformed.
destTag - Name of tag to which source tag is to be transformed.

TagTransformation

public TagTransformation(String sourceTag)
Creates new tag transformation in which specified tag will be skipped (ignored) during parsing process.

Parameters:
sourceTag -
Method Detail

addAttributeTransformation

public void addAttributeTransformation(String targetAttName,
                                       String transformationDesc)
Adds new attribute transformation to this tag transformation. It tells how destination attribute will look like. Small templating mechanism is used to describe attribute value: all names between ${ and } inside the template are evaluated against source tag attributes. That way one can make attribute values consist of mix of source tag attributes.

Parameters:
targetAttName - Name of the destination attribute
transformationDesc - Template describing attribute value.

addAttributeTransformation

public void addAttributeTransformation(String targetAttName)
Adds new attribute transformation in which destination attrbute will not exists (simply removes it from list of attributes).

Parameters:
targetAttName -


Copyright © 2006-2011. All Rights Reserved.