ADDRESS_TYPE_EMAIL, ADDRESS_TYPE_IP, ADDRESS_TYPE_SMS, CSS_BOOLEANINPUT, CSS_DATEINPUT, CSS_DURATIONINPUT, CSS_ERRORINPUT, CSS_ERRORTEXT, CSS_INTINPUT, CSS_REQUIRED, CSS_TEXTINPUT, CSS_WARNINGINPUT, CSS_WARNINGTEXT, CSV_DELIMITER, DELIMITER, LANGUAGE_ATTRIBUTE_NAME, LANGUAGE_DEFAULT, LANGUAGES, MSGREL_AFTER, MSGREL_BEFORE, RESOURCE_STATUS_AVAILABLE, RESOURCE_STATUS_NOTAVAILABLE, RESOURCE_STATUS_REQUESTED, RESOURCE_STATUS_RESERVED, RESOURCE_STATUS_UNCHECKED, RESOURCE_STATUS_UNKNOWN, UTILISATION_TYPE_BEGIN, UTILISATION_TYPE_END, UTILISATION_TYPE_PLAN, WORD_SEPARATORS, XML_ACTIVITY, XML_ACTIVITYNAME, XML_ACTIVITYTYPE, XML_ADDRESS, XML_ADDRESSTYPE, XML_CAPABILITY, XML_CASEID, XML_CATEGORY, XML_CHANNEL, XML_DUMMY, XML_DURATION, XML_ENDTASKID, XML_ERROR, XML_EVENT_RECEIVE, XML_FILTERMODEL, XML_FROM, XML_ID, XML_MAX, XML_MESSAGE_SEND, XML_MESSAGEPUSH_SEND, XML_MESSAGES, XML_MIN, XML_MSGBODY, XML_MSGDURATION, XML_MSGREL, XML_MSGTO, XML_MSGTRANSFER, XML_MSGUTILISATIONTYPE, XML_OTHERACTIVITYNAME, XML_OTHERUTILISATIONTYPE, XML_PAYLOAD, XML_REQUESTTYPE, XML_RESCHEDULING, XML_RESERVATION, XML_RESERVATIONID, XML_RESOURCE, XML_RESOURCE_TYPE, XML_ROLE, XML_RUP, XML_RUP_LIGHT, XML_STARTTASKID, XML_STATUS, XML_STATUSTOBE, XML_SUBCATEGORY, XML_TEXT, XML_THISUTILISATIONTYPE, XML_TIMESTAMP, XML_TO, XML_UNIT, XML_UTILISATION, XML_UTILISATION_TYPE, XML_UTILISATIONREL, XML_UTILISATIONTYPE, XML_WARNING, XML_WORKLOAD, XSDDatatypes_Boolean, XSDDatatypes_DateTime, XSDDatatypes_Double, XSDDatatypes_Duration, XSDDatatypes_Int, XSDDatatypes_Long, XSDDatatypes_String
Constructor and Description |
---|
XMLUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addAttributeValue(Element e,
java.lang.String attr,
java.lang.String value,
java.lang.String... args) |
static void |
addErrorValue(Element e,
boolean withValidation,
java.lang.String value,
java.lang.String... args) |
static void |
addWarningValue(Element e,
java.lang.String value,
java.lang.String... args) |
static boolean |
different(Element e1,
Element e2) |
static java.util.Set<java.lang.String> |
getActivityNames(Element e)
returns all activity names from element e recursively
|
static Attribute |
getAttribute(Document doc,
java.lang.String xpath) |
static java.lang.Boolean |
getBooleanValue(Element element,
boolean withValidation) |
static java.lang.String |
getCaseId(Document rup) |
static java.util.Date |
getDateValue(Element element,
boolean withValidation) |
static java.lang.String |
getDefaultFromSchema(java.lang.String elementName) |
static java.lang.Double |
getDoubleValue(Element element,
boolean withValidation) |
static javax.xml.datatype.Duration |
getDurationValue(Element element,
boolean withValidation) |
static java.lang.Integer |
getDurationValueInMinutes(Element element,
boolean withValidation) |
static java.util.Date |
getEarliestBeginDate(Document rup)
find earliest FROM date of rup
|
static Element |
getEarliestBeginElement(Document rup,
java.lang.String[] possibleActivities)
find earliest FROM element of rup
|
static Element |
getElement(Document doc,
java.lang.String xpath) |
static java.util.List<Element> |
getElements(Document doc,
java.lang.String xpath) |
static java.util.List<java.lang.String> |
getEnumerationFromSchema(java.lang.String name)
return constants defined in XSD enumerations sind als simpleType definiert
|
static java.util.Set<java.lang.String> |
getErrors(Element element) |
static java.lang.String |
getErrorValue(Element e) |
static java.lang.Integer |
getIntegerValue(Element element,
boolean withValidation) |
static java.util.Date |
getLatestEndDate(Document rup)
find latest TO date of rup
|
static Element |
getLatestEndElement(Document rup,
java.lang.String[] possibleActivities)
find latest TO element of rup
|
static java.lang.Long |
getLongValue(Element element,
boolean withValidation) |
static java.util.Collection<Document> |
getSchemaDocs() |
static java.lang.String |
getStringValue(Element element,
boolean withValidation) |
static java.lang.String |
getUnitFromSchema(java.lang.String elementName) |
static java.lang.String |
getWarningValue(Element e) |
static java.util.List |
getXMLObjects(Document doc,
java.lang.String xpath) |
static java.lang.String |
getXPATH_Activities(java.lang.String... activityNames) |
static java.lang.String |
getXPATH_ActivitiesElement(java.lang.String[] activityNames,
java.lang.String elementName,
java.lang.Integer index) |
static java.lang.String |
getXPATH_ActivityElement(java.lang.String activityName,
java.lang.String elementName,
java.lang.Integer index) |
static java.lang.String |
getXPATH_ResOrUtilElement(java.lang.String activityName,
java.lang.String resOrUtilName,
java.lang.Integer resOrUtilIdx,
java.lang.String elementName) |
static java.lang.String |
getXPATH_Resource(java.lang.String activityName,
java.lang.Integer resIdx) |
static java.lang.String |
getXPATH_ResourceElement(java.lang.String activityName,
java.lang.Integer resIdx,
java.lang.String elementName) |
static java.lang.String |
getXPATH_ResourceElement(java.lang.String activityName,
java.lang.Integer resIdx,
java.lang.String elementName,
java.lang.String elementText) |
static java.lang.String |
getXPATH_RUP() |
static boolean |
hasErrors(Element element) |
static boolean |
hasWarnings(Element element) |
static boolean |
isEnumerationFromSchema(java.lang.String elementName) |
static boolean |
isEqualXMLText(java.lang.String t1,
java.lang.String t2)
compares textual content of two elements which are get with
element.getChildText() content of a non-existing element is equal to
content of an element without text
|
static boolean |
isReadonlyFromSchema(java.lang.String elementName) |
static boolean |
isRequiredFromSchema(java.lang.String elementName) |
static boolean |
isVisibleFromSchema(java.lang.String elementName) |
static boolean |
mergeElements(Element minor,
Element major)
merges content of two elements recursively into element minor following
content will be copied: Text, Element, Attribute if conflicts, minor will
be overwrite with content of major
|
static void |
removeAttribute(Element e,
java.lang.String attr) |
static void |
removeAttributes(Element element,
java.lang.String attr) |
static void |
setChildText(Element elem,
java.lang.String childName,
java.lang.String childText)
set childText on elem's child, if child doesn't exist, it will be created
|
static void |
setDateValue(Element element,
java.util.Date value) |
static void |
setDefaults(Element elem) |
static void |
setDurationValue(Element element,
long value) |
static void |
setLongValue(Element element,
java.lang.Long value) |
static void |
setStringValue(Element element,
java.lang.String value) |
static void |
validate(Element msg) |
static void |
validate(java.lang.String msgText)
Datentyp�berpr�fung und angabe des betroffenen elements, es werden alle
gefundenen Fehler ausgegeben Xerces DocumentBuilder method, called by
validator.validate(), isn't thread safe
|
static java.lang.String |
validateElement(Element element,
Element typeElement,
java.util.List<Element> restrictions,
boolean withValidation)
validates element of resource utilisation plan against type element from
schema return cs class for element
|
public static java.util.Collection<Document> getSchemaDocs()
public static java.util.List<java.lang.String> getEnumerationFromSchema(java.lang.String name)
public static java.lang.String getDefaultFromSchema(java.lang.String elementName)
public static java.lang.String getUnitFromSchema(java.lang.String elementName)
public static boolean isVisibleFromSchema(java.lang.String elementName)
public static boolean isReadonlyFromSchema(java.lang.String elementName)
public static boolean isEnumerationFromSchema(java.lang.String elementName)
public static boolean isRequiredFromSchema(java.lang.String elementName)
public static void setDefaults(Element elem)
public static void validate(java.lang.String msgText) throws java.io.IOException, org.xml.sax.SAXException
msgText
- java.io.IOException
org.xml.sax.SAXException
public static void validate(Element msg) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public static java.lang.String validateElement(Element element, Element typeElement, java.util.List<Element> restrictions, boolean withValidation) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, JDOMException
javax.xml.datatype.DatatypeConfigurationException
java.io.IOException
JDOMException
public static java.lang.String getErrorValue(Element e)
public static java.lang.String getWarningValue(Element e)
public static void addErrorValue(Element e, boolean withValidation, java.lang.String value, java.lang.String... args)
public static void addWarningValue(Element e, java.lang.String value, java.lang.String... args)
public static void addAttributeValue(Element e, java.lang.String attr, java.lang.String value, java.lang.String... args)
public static void removeAttributes(Element element, java.lang.String attr)
public static void removeAttribute(Element e, java.lang.String attr)
public static boolean hasErrors(Element element)
public static boolean hasWarnings(Element element)
public static java.util.Set<java.lang.String> getErrors(Element element)
public static java.util.Date getDateValue(Element element, boolean withValidation)
public static void setDateValue(Element element, java.util.Date value)
public static void setDurationValue(Element element, long value)
public static void setLongValue(Element element, java.lang.Long value)
public static java.lang.String getStringValue(Element element, boolean withValidation)
public static void setStringValue(Element element, java.lang.String value)
public static javax.xml.datatype.Duration getDurationValue(Element element, boolean withValidation)
public static java.lang.Integer getDurationValueInMinutes(Element element, boolean withValidation)
public static java.lang.Double getDoubleValue(Element element, boolean withValidation)
public static java.lang.Integer getIntegerValue(Element element, boolean withValidation)
public static java.lang.Long getLongValue(Element element, boolean withValidation)
public static java.lang.Boolean getBooleanValue(Element element, boolean withValidation)
public static java.lang.String getXPATH_RUP()
public static java.lang.String getXPATH_Activities(java.lang.String... activityNames)
public static java.lang.String getXPATH_ActivitiesElement(java.lang.String[] activityNames, java.lang.String elementName, java.lang.Integer index)
public static java.lang.String getXPATH_ActivityElement(java.lang.String activityName, java.lang.String elementName, java.lang.Integer index)
public static java.lang.String getXPATH_ResOrUtilElement(java.lang.String activityName, java.lang.String resOrUtilName, java.lang.Integer resOrUtilIdx, java.lang.String elementName)
public static java.lang.String getXPATH_Resource(java.lang.String activityName, java.lang.Integer resIdx)
public static java.lang.String getXPATH_ResourceElement(java.lang.String activityName, java.lang.Integer resIdx, java.lang.String elementName)
public static java.lang.String getXPATH_ResourceElement(java.lang.String activityName, java.lang.Integer resIdx, java.lang.String elementName, java.lang.String elementText)
public static boolean different(Element e1, Element e2) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public static boolean isEqualXMLText(java.lang.String t1, java.lang.String t2)
t1
- t2
- public static java.util.List getXMLObjects(Document doc, java.lang.String xpath)
public static void setChildText(Element elem, java.lang.String childName, java.lang.String childText)
elem
- childName
- childText
- public static boolean mergeElements(Element minor, Element major) throws java.lang.Exception
minor
- major
- java.lang.Exception
public static java.util.Set<java.lang.String> getActivityNames(Element e)
e
- public static java.lang.String getCaseId(Document rup)
public static Element getEarliestBeginElement(Document rup, java.lang.String[] possibleActivities)
public static java.util.Date getEarliestBeginDate(Document rup)
public static Element getLatestEndElement(Document rup, java.lang.String[] possibleActivities)
public static java.util.Date getLatestEndDate(Document rup)
Copyright © 2004-2014 The YAWL Foundation.