uk.ac.bbk.dcs.automed.xml.utilities
Class UIDUtility

java.lang.Object
  extended by uk.ac.bbk.dcs.automed.xml.utilities.UIDUtility

public class UIDUtility
extends java.lang.Object

This class contains various methods related to the XML unique identifiers (UIDs) used in the AutoMed XML toolkit

Schema UIDs are of the form elementName$count_sid

Instance UIDs are of the form elementName$count_sid&instanceCount

Author:
Lucas Zamboulis

Field Summary
protected static java.util.logging.Logger logger
           
static char separator1
           
static char separator2
           
static char separator3
           
 
Constructor Summary
UIDUtility()
           
 
Method Summary
static Schema changeSchemaUIDs(Schema s, java.lang.String newSchemaName)
           
static java.util.LinkedList generatorsFromXPath(java.lang.String genVar, java.lang.String xpath, java.util.HashMap map, org.w3c.dom.Document schemaUIDDoc)
           
static java.lang.String getAutoMedID(org.w3c.dom.Node n)
           
static org.w3c.dom.Element getElementByCID(org.w3c.dom.Document doc, java.lang.String cid)
          Returns the node in the input doc that has an AutoMedID with the value of elementCID
static org.w3c.dom.Node getElementByUID(org.w3c.dom.Document doc, java.lang.String elemUID)
          Returns the node in the input doc that has an AutoMedID with the value of elementUID
static java.lang.String getElementName(java.lang.String uid)
           
static java.lang.String getInstUID(java.lang.String elemCID, long sid, long instanceCount)
           
static boolean isAttribute(java.lang.String uid)
           
static boolean isCDataNestListUID(java.lang.String uid)
           
static boolean isCDataUID(java.lang.String uid)
           
static boolean isPCDataNestListUID(java.lang.String uid)
           
static boolean isPCDataUID(java.lang.String uid)
           
static boolean isTextNestListUID(java.lang.String uid)
           
static boolean isTextUID(java.lang.String uid)
           
static org.w3c.dom.Document stripUIDs(org.w3c.dom.Document inputDoc)
          This method takes as input an XML document in DOM format, duplicates it, then strips the uids from the duplicated DOM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static java.util.logging.Logger logger

separator1

public static final char separator1
See Also:
Constant Field Values

separator2

public static final char separator2
See Also:
Constant Field Values

separator3

public static final char separator3
See Also:
Constant Field Values
Constructor Detail

UIDUtility

public UIDUtility()
Method Detail

changeSchemaUIDs

public static Schema changeSchemaUIDs(Schema s,
                                      java.lang.String newSchemaName)
                               throws XMLException
Throws:
XMLException

stripUIDs

public static org.w3c.dom.Document stripUIDs(org.w3c.dom.Document inputDoc)
This method takes as input an XML document in DOM format, duplicates it, then strips the uids from the duplicated DOM.

Parameters:
inputDoc - the input document
Returns:
the inputDoc without uids

isAttribute

public static boolean isAttribute(java.lang.String uid)

isPCDataUID

public static boolean isPCDataUID(java.lang.String uid)

isCDataUID

public static boolean isCDataUID(java.lang.String uid)

isTextUID

public static boolean isTextUID(java.lang.String uid)

isPCDataNestListUID

public static boolean isPCDataNestListUID(java.lang.String uid)

isCDataNestListUID

public static boolean isCDataNestListUID(java.lang.String uid)

isTextNestListUID

public static boolean isTextNestListUID(java.lang.String uid)

getElementName

public static java.lang.String getElementName(java.lang.String uid)

getAutoMedID

public static java.lang.String getAutoMedID(org.w3c.dom.Node n)

getInstUID

public static java.lang.String getInstUID(java.lang.String elemCID,
                                          long sid,
                                          long instanceCount)

getElementByUID

public static org.w3c.dom.Node getElementByUID(org.w3c.dom.Document doc,
                                               java.lang.String elemUID)
Returns the node in the input doc that has an AutoMedID with the value of elementUID


getElementByCID

public static org.w3c.dom.Element getElementByCID(org.w3c.dom.Document doc,
                                                  java.lang.String cid)
Returns the node in the input doc that has an AutoMedID with the value of elementCID


generatorsFromXPath

public static java.util.LinkedList generatorsFromXPath(java.lang.String genVar,
                                                       java.lang.String xpath,
                                                       java.util.HashMap map,
                                                       org.w3c.dom.Document schemaUIDDoc)
                                                throws java.lang.Exception
Throws:
java.lang.Exception