org.mmbase.datatypes.util.xml
Class DataTypeXml

java.lang.Object
  extended byorg.mmbase.datatypes.util.xml.DataTypeXml

public abstract class DataTypeXml
extends Object

Static methods used for parsing of datatypes.xml

Since:
MMBase-1.8
Version:
$Id: DataTypeXml.java,v 1.5 2005/12/29 23:02:22 michiel Exp $
Author:
Michiel Meeuwissen

Constructor Summary
DataTypeXml()
           
 
Method Summary
static CommitProcessor chainProcessors(CommitProcessor processor1, CommitProcessor processor2)
           
static Processor chainProcessors(Processor processor1, Processor processor2)
           
static CommitProcessor createCommitProcessor(Element processorElement)
           
static Processor createProcessor(Element processorElement)
           
protected static String getAttribute(Element element, String localName)
          Returns the value of a certain attribute, either an unqualified attribute or an attribute that fits in the default namespace
static boolean getBooleanValue(Element element, boolean defaultValue)
           
static LocalizedString getLocalizedDescription(String tagName, Element element, LocalizedString descriptions, String defaultKey)
          Reads a number of tags with 'xml:lang' attributes.
static long getLongValue(Element element)
           
static String getValue(Element element)
           
static boolean hasAttribute(Element element, String localName)
          Returns whether an element has a certain attribute, either an unqualified attribute or an attribute that fits in the default namespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeXml

public DataTypeXml()
Method Detail

hasAttribute

public static boolean hasAttribute(Element element,
                                   String localName)
Returns whether an element has a certain attribute, either an unqualified attribute or an attribute that fits in the default namespace


getAttribute

protected static String getAttribute(Element element,
                                     String localName)
Returns the value of a certain attribute, either an unqualified attribute or an attribute that fits in the default namespace


getLocalizedDescription

public static LocalizedString getLocalizedDescription(String tagName,
                                                      Element element,
                                                      LocalizedString descriptions,
                                                      String defaultKey)
Reads a number of tags with 'xml:lang' attributes.

Parameters:
tagName - Wich tags to read. The bodies are the values.
element - From which element this tags must be childs.
descriptions - Existing LocalizedString instance or null if a new one must be created.
defaultKey - If the localized string was created with some silly automatic key, it can be provided here, in which case it will be changed if a tag withouth xml:lang is found, or with xml:lang equals the current default. It can also be null
Returns:
A new LocalizedString or the updated 'descriptions' parameter if that was not null

getBooleanValue

public static boolean getBooleanValue(Element element,
                                      boolean defaultValue)

chainProcessors

public static Processor chainProcessors(Processor processor1,
                                        Processor processor2)

chainProcessors

public static CommitProcessor chainProcessors(CommitProcessor processor1,
                                              CommitProcessor processor2)

createProcessor

public static Processor createProcessor(Element processorElement)

createCommitProcessor

public static CommitProcessor createCommitProcessor(Element processorElement)

getValue

public static String getValue(Element element)

getLongValue

public static long getLongValue(Element element)


MMBase build 1.8.1.20060716