org.jopendocument.dom
Class OOUtils

java.lang.Object
  extended by org.jopendocument.dom.OOUtils

public class OOUtils
extends Object


Constructor Summary
OOUtils()
           
 
Method Summary
static Color decodeRGB(String color)
          Decode a color.
static String encodeRGB(Color color)
          Encode to the color data type, see section 18.3.8 of OpenDocument-v1.2-part1.
static org.jdom.input.SAXBuilder getBuilder()
          Return a builder who doesn't load DTD.
static org.jdom.input.SAXBuilder getBuilderLoadDTD()
          Return a builder who loads DTD.
static org.jdom.xpath.XPath getXPath(String path, XMLVersion version)
          Create an XPath with OO namespaces.
static void open(File f)
          Open the passed file in OpenOffice.
static org.jdom.Document parseDocument(String doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OOUtils

public OOUtils()
Method Detail

open

public static void open(File f)
                 throws IOException
Open the passed file in OpenOffice.

Parameters:
f - the file to open.
Throws:
IOException - if openoffice could not be opened

getBuilder

public static org.jdom.input.SAXBuilder getBuilder()
Return a builder who doesn't load DTD.

Returns:
a builder who doesn't load DTD.

getBuilderLoadDTD

public static org.jdom.input.SAXBuilder getBuilderLoadDTD()
Return a builder who loads DTD.

Returns:
a builder who loads DTD.

parseDocument

public static org.jdom.Document parseDocument(String doc)
                                       throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException

getXPath

public static final org.jdom.xpath.XPath getXPath(String path,
                                                  XMLVersion version)
                                           throws org.jdom.JDOMException
Create an XPath with OO namespaces.

Parameters:
path - the xpath to create.
version - XML version.
Returns:
the specified XPath.
Throws:
org.jdom.JDOMException - if the path is malformed.

encodeRGB

public static String encodeRGB(Color color)
Encode to the color data type, see section 18.3.8 of OpenDocument-v1.2-part1.

Parameters:
color - a color
Returns:
the string encoded version.

decodeRGB

public static Color decodeRGB(String color)
Decode a color.

Parameters:
color - a RGB color in notation "#rrggbb", can be null.
Returns:
the corresponding color.
See Also:
encodeRGB(Color)


Copyright © 2010 jOpenDocument All Rights Reserved.