EPP 0.2.5

com.neulevel.epp.core
Class EppUtil

java.lang.Object
  |
  +--com.neulevel.epp.core.EppUtil

public class EppUtil
extends java.lang.Object

The EppUtil class implements some utility methods used by various components in the EPP implementation.

Version:
$Revision: 1.1 $ $Date: 2001/11/05 20:20:36 $
Author:
Ning Zhang ning.zhang@neustar.com

Field Summary
static java.lang.String xmlFullNamespace
          Property for generating tags with namespace prefixes.
 
Constructor Summary
EppUtil()
           
 
Method Summary
static org.apache.xerces.dom.ElementNSImpl createElementNS(org.w3c.dom.Document doc, java.lang.String ns, java.lang.String tag)
          Creates an ElementNSImpl object inside a Document object.
static org.apache.xerces.dom.ElementNSImpl createElementNS(org.w3c.dom.Document doc, java.lang.String ns, java.lang.String tag, boolean flag)
          Creates an ElementNSImpl object inside a Document object.
static org.apache.xerces.dom.ElementNSImpl createElementNSUnspec(org.w3c.dom.Document doc, java.lang.String unspec, java.lang.String tag, boolean flag)
          Creates an ElementNSImpl object inside a Document object.
static org.w3c.dom.Text createTextNode(org.w3c.dom.Document doc, java.util.Calendar cal)
          Creates a Text node for converting a Calendar object into a string of XML timeInstant type.
static org.w3c.dom.Text createTextNode(org.w3c.dom.Document doc, java.util.Calendar cal, boolean dateOnly)
          Creates a Text node for converting a Calendar object into a string of XML timeInstant type or XML date type.
static java.util.Calendar getDate(org.w3c.dom.Node root)
          Converts a text string associated with a node into a Calendar object
static java.util.Calendar getDate(org.w3c.dom.Node root, boolean dateOnly)
          Converts a text string associated with a node into a Calendar object
static java.lang.String getEppVersion()
          Gets the EPP XSD file version.
static java.lang.String getText(org.w3c.dom.Node root)
          Gets the text string associated with a node
static void setEppVersion(java.lang.String eppVersion)
          Sets the EPP XSD file version.
static java.lang.String toString(org.w3c.dom.Document doc)
          Converts a Document into a formated XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlFullNamespace

public static final java.lang.String xmlFullNamespace
Property for generating tags with namespace prefixes.
Constructor Detail

EppUtil

public EppUtil()
Method Detail

setEppVersion

public static void setEppVersion(java.lang.String eppVersion)
Sets the EPP XSD file version. The default value is "1.0", for EPP Schema dated on June 29, 2001.

getEppVersion

public static java.lang.String getEppVersion()
Gets the EPP XSD file version.

createElementNS

public static org.apache.xerces.dom.ElementNSImpl createElementNS(org.w3c.dom.Document doc,
                                                                  java.lang.String ns,
                                                                  java.lang.String tag)
Creates an ElementNSImpl object inside a Document object. The namespace associated with the object is specific to EPP.
Parameters:
doc - Document object in which the new element to be created.
ns - The namespace of the new element to be created.
tag - The tag name of the new element to be created.
Returns:
an ElementNSImpl object

createElementNS

public static org.apache.xerces.dom.ElementNSImpl createElementNS(org.w3c.dom.Document doc,
                                                                  java.lang.String ns,
                                                                  java.lang.String tag,
                                                                  boolean flag)
Creates an ElementNSImpl object inside a Document object. The namespace associated with the object is specific to EPP.
Parameters:
doc - Document object in which the new element to be created.
ns - The namespace of the new element to be created.
tag - The tag name of the new element to be created.
flag - The flag indicating if the default namespace is needed.
Returns:
an ElementNSImpl object

createElementNSUnspec

public static org.apache.xerces.dom.ElementNSImpl createElementNSUnspec(org.w3c.dom.Document doc,
                                                                        java.lang.String unspec,
                                                                        java.lang.String tag,
                                                                        boolean flag)
Creates an ElementNSImpl object inside a Document object. The namespace associated with the object is specific to an unspec object in an EppServiceMenu object.
Parameters:
doc - Document object in which the new element to be created.
unspec - The string containing the information about the unspec object with three tokens: name, uri, schema. For example: "obj1ext http://custom/obj1ext-1.0 obj1ext-1.0.xsd"
tag - The tag name of the new element to be created.
flag - The flag indicating if the default namespace is needed.
Returns:
an ElementNSImpl object, or null if the unspec parameter is not valid.

createTextNode

public static org.w3c.dom.Text createTextNode(org.w3c.dom.Document doc,
                                              java.util.Calendar cal)
Creates a Text node for converting a Calendar object into a string of XML timeInstant type.
Parameters:
doc - Document object in which the new element to be created.
cal - The Calendar to be converted into a XML Text node.

createTextNode

public static org.w3c.dom.Text createTextNode(org.w3c.dom.Document doc,
                                              java.util.Calendar cal,
                                              boolean dateOnly)
Creates a Text node for converting a Calendar object into a string of XML timeInstant type or XML date type.
Parameters:
doc - Document object in which the new element to be created.
cal - The Calendar to be converted into a XML Text node.
dateOnly - true if the format is XML date type, or false if the format is XML timeInstant type

getText

public static java.lang.String getText(org.w3c.dom.Node root)
Gets the text string associated with a node
Parameters:
root - Node object from which text to be extracted.
Returns:
a string associated with the node

getDate

public static java.util.Calendar getDate(org.w3c.dom.Node root)
Converts a text string associated with a node into a Calendar object
Parameters:
root - Node object from which text to be extracted.
Returns:
a Calendar object, or null if the text string is not a valid XML timeInstant string

getDate

public static java.util.Calendar getDate(org.w3c.dom.Node root,
                                         boolean dateOnly)
Converts a text string associated with a node into a Calendar object
Parameters:
root - Node object from which text to be extracted.
dateOnly - true for parsing the string in XML date format, or false for parsing the string in XML timeInstant format
Returns:
a Calendar object, or null if the text string is not a valid XML timeInstant/date string

toString

public static java.lang.String toString(org.w3c.dom.Document doc)
Converts a Document into a formated XML string.
Parameters:
doc - Document to be converted into a string.
Returns:
a string representing the formated XML document

EPP 0.2.5

Copyright © 2001-2002 NeuLevel, Inc. All Rights Reserved.