org.mmbase.datatypes.processors.xml
Class Modes

java.lang.Object
  extended by org.mmbase.datatypes.processors.xml.Modes

public abstract class Modes
extends Object

XML-modes. XML-modes can be attributed to a Cloud (using Cloud.setProperty(java.lang.Object, java.lang.Object) and Cloud.PROP_XMLMODE) and influence how an XML field must behave itself. XML is all about flexibility of presentation, and this mode regulates that. It boils down to the fact that 'processors' can be plugged on XML fields which can use this 'mode' to behave differently. Most modes will influence especially Node.setStringValue(String, String) and Node.getStringValue(String). (depending on the datatypes.xml), but some modes could also set/get XMLValue.

Since:
MMBase-1.8
Version:
$Id: Modes.java 34936 2009-05-04 14:41:51Z michiel $
Author:
Michiel Meeuwissen

Field Summary
static int DOCBOOK
          Makes the field look like Docbook XML.
static int FLAT
          FLAT would return only the text from an XML field, so plain text without all XML markup.
static int KUPU
          KUPU-mode should trigger relations to be followed (on get) and be created (on set), and should give and receive XHTML which will be (on get) or was (on set) edited by the 'kupu' editor.
static int PRETTYXML
          PRETTYXML is like XML, but one could expect extra indentation and newlines to make the XML more readable for humans.
static int WIKI
          WIKI is a bit like FLAT, but effort is made to give a better representation of the XML in plain text.
static int XML
          The 'XML' mode should mean that the XML will be sent and expected as 'pure' as possible.
 
Method Summary
static int getMode(Object m)
          Converts a String identifier to one of the constants in this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML

public static final int XML
The 'XML' mode should mean that the XML will be sent and expected as 'pure' as possible. E.g. getString of an XML value in 'XML' mode should normally return a straight-forward stringification of the XML.

See Also:
Constant Field Values

PRETTYXML

public static final int PRETTYXML
PRETTYXML is like XML, but one could expect extra indentation and newlines to make the XML more readable for humans. So, on getString you could expect a String which is not quite the XML from the database, but chances are that it is equivalent.

See Also:
Constant Field Values

FLAT

public static final int FLAT
FLAT would return only the text from an XML field, so plain text without all XML markup. Setting an XML value in 'FLAT' mode would generally be far from perfect.

See Also:
Constant Field Values

WIKI

public static final int WIKI
WIKI is a bit like FLAT, but effort is made to give a better representation of the XML in plain text. This mode could probably even be used when setting the field (This works e.g. quite well for 'mmxf' fields).

See Also:
Constant Field Values

KUPU

public static final int KUPU
KUPU-mode should trigger relations to be followed (on get) and be created (on set), and should give and receive XHTML which will be (on get) or was (on set) edited by the 'kupu' editor. See kupu.

See Also:
Constant Field Values

DOCBOOK

public static final int DOCBOOK
Makes the field look like Docbook XML. So, this could be implemented on get/set XMLValue as well.

See Also:
Constant Field Values
Method Detail

getMode

public static int getMode(Object m)
Converts a String identifier to one of the constants in this class



MMBase 2.0-SNAPSHOT - null