|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xnode.XNodeUtils
public class XNodeUtils
Provides some static XNode utility methods. This includes some string utilities copied from org.ceryle.util.Utilities to remove the dependency on that class for XNode-specific implementations.
| Field Summary | |
|---|---|
static String |
EMPTY_STRING
|
| Constructor Summary | |
|---|---|
XNodeUtils()
|
|
| Method Summary | |
|---|---|
static String |
convertFromList(List list)
Converts the provided List of Strings to a whitespace-delimited String. |
static List |
convertToList(String s,
String delim)
Converts the whitespace-delimited String s to a List of Strings. |
static String[] |
decomposeURI(String baseURI,
String uri)
Returns the Collection ID, Node ID, and fragment ID as Strings provided using the database root URI compared with an 'xnode:' URI uri, assuming it is has an xnode: protocol. |
static Map |
getProperties(Element header)
Provided with the <xnode:Header> DOM Element, returns a Map of name-value pairs of Strings. |
static boolean |
listsAreEquivalent(List a,
List b)
Returns true if the two lists contain the same objects in the same order. |
static String |
metadataMatches(Element header1,
Element header2,
boolean matchDates,
boolean matchVersion)
Returns null if the two <xnode:Header> elements contain the same set of <xnode:Property> (name-value pairs of metadata) elements, matching on both name and value. |
static void |
modifyXNodeContent(XNode xnode,
String content)
Sets the content of the provided XNode to a CDATASection created from the String content. |
static void |
serialize(XNode xnode,
Object out,
boolean close)
Serializes the provided XNode's content to the Object out using the serialization method determined by the XNode's format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String EMPTY_STRING
| Constructor Detail |
|---|
public XNodeUtils()
| Method Detail |
|---|
public static void serialize(XNode xnode,
Object out,
boolean close)
throws XNodeException
xnode - the optional XNode that is used to set
the public and system identifiers, if present.out - the File, Writer or OutputStream
to receive the serialized content.close - when true, closes the writer upon completion
XNodeException - if a serialization error occurs.
public static String metadataMatches(Element header1,
Element header2,
boolean matchDates,
boolean matchVersion)
If matchDates is true, checks the created date, and if both are available, the modified dates for a match. If there is a mismatch on either created or modified dates, returns an appropriate message.
If matchVersion is true, the version number property must also match; otherwise it is ignored. If a mismatch if found, returns a message describing the first mismatch found.
public static Map getProperties(Element header)
public static void modifyXNodeContent(XNode xnode,
String content)
throws XNodeException
XNodeException
public static List convertToList(String s,
String delim)
public static String convertFromList(List list)
public static boolean listsAreEquivalent(List a,
List b)
public static String[] decomposeURI(String baseURI,
String uri)
throws XNodeException
(this is not an XNode API method)
XNodeException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||