org.jopendocument.dom
Enum XMLVersion

java.lang.Object
  extended by java.lang.Enum<XMLVersion>
      extended by org.jopendocument.dom.XMLVersion
All Implemented Interfaces:
Serializable, Comparable<XMLVersion>

public enum XMLVersion
extends Enum<XMLVersion>

Encapsulate all namespaces for a particular version of xml.

Author:
ILM Informatique 26 juil. 2004

Enum Constant Summary
OD
           
OOo
           
 
Field Summary
static org.jdom.Namespace DIALOG_NS
           
static org.jdom.Namespace LIBRARY_NS
           
 
Method Summary
 org.jdom.Namespace[] getALL()
           
static XMLVersion getDefault()
           
 org.jdom.Namespace getLibrariesNS()
           
 org.jdom.Namespace getManifest()
           
 org.jdom.Namespace getMETA()
           
 String getName()
           
 org.jdom.Namespace getNS(String prefix)
           
static XMLVersion getOD()
          Namespaces for OpenDocument/OpenOffice.org 2.x.
 org.jdom.Namespace getOFFICE()
           
static XMLVersion getOOo()
          Namespaces for OpenOffice.org 1.x.
static XMLVersion getParent(org.jdom.Namespace ns)
          Find the NS to which belongs the passed namespace.
 org.jdom.Namespace getSTYLE()
           
 org.jdom.Namespace getTABLE()
           
 org.jdom.Namespace getTEXT()
           
static XMLVersion getVersion(org.jdom.Document doc)
           
static XMLVersion getVersion(org.jdom.Element elem)
          Infer the version of an XML element from its namespace.
protected  void put(String prefix, String uri)
           
protected  void putMandatory(String office, String style, String text, String table)
           
static XMLVersion valueOf(String name)
          Returns the enum constant of this type with the specified name.
static XMLVersion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OOo

public static final XMLVersion OOo

OD

public static final XMLVersion OD
Field Detail

LIBRARY_NS

public static final org.jdom.Namespace LIBRARY_NS

DIALOG_NS

public static final org.jdom.Namespace DIALOG_NS
Method Detail

values

public static XMLVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (XMLVersion c : XMLVersion.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static XMLVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

putMandatory

protected final void putMandatory(String office,
                                  String style,
                                  String text,
                                  String table)

put

protected final void put(String prefix,
                         String uri)

getNS

public final org.jdom.Namespace getNS(String prefix)

getName

public final String getName()

getManifest

public final org.jdom.Namespace getManifest()

getOFFICE

public org.jdom.Namespace getOFFICE()

getSTYLE

public org.jdom.Namespace getSTYLE()

getTEXT

public org.jdom.Namespace getTEXT()

getTABLE

public org.jdom.Namespace getTABLE()

getMETA

public org.jdom.Namespace getMETA()

getALL

public org.jdom.Namespace[] getALL()

getLibrariesNS

public org.jdom.Namespace getLibrariesNS()

getOOo

public static final XMLVersion getOOo()
Namespaces for OpenOffice.org 1.x.

Returns:
namespaces for OO.o 1.

getOD

public static final XMLVersion getOD()
Namespaces for OpenDocument/OpenOffice.org 2.x.

Returns:
namespaces for OpenDocument.

getParent

public static final XMLVersion getParent(org.jdom.Namespace ns)
Find the NS to which belongs the passed namespace.

Parameters:
ns - the namespace, eg office=http://openoffice.org/2000/office.
Returns:
the matching NS, eg NS.getOOo(), or null if none is found.

getVersion

public static final XMLVersion getVersion(org.jdom.Document doc)

getVersion

public static final XMLVersion getVersion(org.jdom.Element elem)
Infer the version of an XML element from its namespace.

Parameters:
elem - the element to be tested, eg <text:line-break/>.
Returns:
the version.
Throws:
IllegalArgumentException - if the namespace is unknown.

getDefault

public static XMLVersion getDefault()


Copyright © 2010 jOpenDocument All Rights Reserved.