|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.omdocjdom.OJUtilities
public class OJUtilities
| Nested Class Summary | |
|---|---|
static class |
OJUtilities.NameAndNamespace
A simple class to contain a record of a name and a namespace. |
| Method Summary | |
|---|---|
static void |
addItemSeparator(org.jdom.Element element)
|
static org.jdom.Element |
duplicateElementWithoutKids(org.jdom.Element elt)
Creates a clone of the element (with namespace, names, and attributes) without copying the kids. |
static OJElement |
duplicateElementWithoutKids(OJElement elt)
Creates a clone of the element (with namespace, names, and attributes) without copying the kids. |
static OJElement |
findElementWithLangOrDefauit(Iterator eltsIt,
String prefLang)
A utility method to scan through the list and find the first element whose xml:lang attribute is the given language or that
has no language. |
static File |
getDocumentsFile(OJElement elt)
Returns the file associated to the document of the elementif there is anything such (i.e there can be no document or no file for the document. |
static Transformer |
getXmlOutputterTransformer()
|
static boolean |
hasText(org.jdom.Element elt,
String s)
Searches through all the descendent text-nodes of the element if the given string exists. |
static boolean |
isConceptName(String s)
Deprecated. Please use, in the future, the ActiveMathConstants class. |
static boolean |
isItemName(String s)
Deprecated. please use OJConstants.isItemName(java.lang.String) |
static boolean |
isOneOfThese(String s,
String[] list)
Checks if the string s is String.equals(java.lang.Object) to this one. |
static void |
printElementWithAtttributes(org.jdom.Element element,
PrintStream out)
Does the same thing as printElementWithAtttributes(org.jdom.Element, java.io.PrintWriter). |
static void |
printElementWithAtttributes(org.jdom.Element element,
PrintWriter out)
Simply prints the "first line" of the element without the kids or closing tag (with namespaces omitted !) |
static String |
relativizePath(String absolutePath,
String basePath)
|
static void |
removeAttributes(OJElement elt,
OJUtilities.NameAndNamespace[] nns)
Walks through all the children of the given element and remove any existing "mid" attribute. |
static void |
removeExtradataMetadataKids(OJElement elt,
OJUtilities.NameAndNamespace[] nns)
A recursive method to remove all the elements with given name from the metadata/extradata children of the given element
or go down along the children of this element. |
static OJElement |
replaceXrefs(OJElement elt,
Map table)
Walks around all the children of the element to check weather there is an OMOBJ xref attribute and replace it with the content it's pointing to. |
static boolean |
stringEquals(String a,
String b)
A utility method to check the equality of two string variables including if they are both null. |
static OJSAXBuilder.LocationInfo |
tryToGetLocationInfo(OJElement elt)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final boolean stringEquals(String a,
String b)
public static final OJElement findElementWithLangOrDefauit(Iterator eltsIt,
String prefLang)
xml:lang attribute is the given language or that
has no language.
eltsIt - an iterator to be consumed by the search,
all elements returned are supposed to be of type ElementprefLang - the preferred language
null if no suitable element found.spublic static final boolean isItemName(String s)
OJConstants.isItemName(java.lang.String)
OJConstants.ITEM_NAMES
public static final boolean isConceptName(String s)
public static final boolean isOneOfThese(String s,
String[] list)
String.equals(java.lang.Object) to this one.
public static final void printElementWithAtttributes(org.jdom.Element element,
PrintWriter out)
public static final void printElementWithAtttributes(org.jdom.Element element,
PrintStream out)
printElementWithAtttributes(org.jdom.Element, java.io.PrintWriter).
public static final File getDocumentsFile(OJElement elt)
public static final org.jdom.Element duplicateElementWithoutKids(org.jdom.Element elt)
OmdocJdomMBase.getChildren(org.activemath.abstractcontent.MBaseID, java.lang.String).
public static final OJElement duplicateElementWithoutKids(OJElement elt)
OmdocJdomMBase.getChildren(org.activemath.abstractcontent.MBaseID, java.lang.String).
public static final boolean hasText(org.jdom.Element elt,
String s)
public static OJElement replaceXrefs(OJElement elt,
Map table)
elt - the element that needs to be walkedtable - the table to find the xref.
public static void removeExtradataMetadataKids(OJElement elt,
OJUtilities.NameAndNamespace[] nns)
metadata/extradata children of the given element
or go down along the children of this element.
This search process stops at OJItem elements from where it makes the remove explict.
elt - the element to start fromnns - an array of OJUtilities.NameAndNamespace pairs to match and remove
public static void removeAttributes(OJElement elt,
OJUtilities.NameAndNamespace[] nns)
public static void addItemSeparator(org.jdom.Element element)
public static String relativizePath(String absolutePath,
String basePath)
public static OJSAXBuilder.LocationInfo tryToGetLocationInfo(OJElement elt)
public static Transformer getXmlOutputterTransformer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||