org.pentaho.reporting.libraries.xmlns.writer
Class DefaultTagDescription

java.lang.Object
  extended by org.pentaho.reporting.libraries.xmlns.writer.DefaultTagDescription
All Implemented Interfaces:
TagDescription

public class DefaultTagDescription
extends java.lang.Object
implements TagDescription

A tag-description provides information about xml tags. At the moment, we simply care whether an element can contain CDATA. In such cases, we do not indent the inner elements.

Author:
Thomas Morgner

Constructor Summary
DefaultTagDescription()
          A default-constructor.
DefaultTagDescription(org.pentaho.reporting.libraries.base.config.Configuration conf, java.lang.String prefix)
          Creates and configures a new TagDescription collection.
 
Method Summary
 void addDefaultDefinition(java.lang.String namespaceUri, boolean hasCData)
          Adds a configuration default for the given namespace to the tag-descriptions.
 void addTagDefinition(java.lang.String namespaceUri, java.lang.String tagName, boolean hasCData)
          Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.
 void configure(org.pentaho.reporting.libraries.base.config.Configuration conf, java.lang.String prefix)
          Configures this factory from the given configuration using the speoified prefix as filter.
 boolean hasCData(java.lang.String namespace, java.lang.String tagname)
          Queries the defined tag-descriptions whether the given tag and namespace is defined to allow character-data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTagDescription

public DefaultTagDescription()
A default-constructor.


DefaultTagDescription

public DefaultTagDescription(org.pentaho.reporting.libraries.base.config.Configuration conf,
                             java.lang.String prefix)
Creates and configures a new TagDescription collection.

Parameters:
conf - the configuration.
prefix - the key-prefix.
See Also:
configure(Configuration, String)
Method Detail

configure

public void configure(org.pentaho.reporting.libraries.base.config.Configuration conf,
                      java.lang.String prefix)
Configures this factory from the given configuration using the speoified prefix as filter.

Parameters:
conf - the configuration.
prefix - the key-prefix.

addDefaultDefinition

public void addDefaultDefinition(java.lang.String namespaceUri,
                                 boolean hasCData)
Adds a configuration default for the given namespace to the tag-descriptions. If the namespace URI given here is null, this defines the global default for all namespaces.

Parameters:
namespaceUri - the namespace URI for which a default should be configured.
hasCData - the default value.

addTagDefinition

public void addTagDefinition(java.lang.String namespaceUri,
                             java.lang.String tagName,
                             boolean hasCData)
Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.

Parameters:
namespaceUri - the namespace URI for which a default should be configured.
tagName - the tagname for which the entry should be added.
hasCData - the default value.

hasCData

public boolean hasCData(java.lang.String namespace,
                        java.lang.String tagname)
Queries the defined tag-descriptions whether the given tag and namespace is defined to allow character-data.

Specified by:
hasCData in interface TagDescription
Parameters:
namespace - the namespace.
tagname - the xml-tagname.
Returns:
true, if the element may contain character data, false otherwise.