public class ParameterValueManagement
extends java.lang.Object
This class implements methods for parameters based on the default implementation inside the
framework. It allows to handle AttachmentValue and StringValue as before.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ALLOW_NOINDEX |
protected static HashMap |
registeredValues
This map contains mappings from XML Schema datatypes to the classes which will be loaded at
runtime.
|
static int |
TYPE_ATTACHMENT |
static java.lang.String |
TYPE_ATTACHMENT_CLASS |
static int |
TYPE_COMPLEX |
static int |
TYPE_QNAME |
static java.lang.String |
TYPE_QNAME_CLASS |
static int |
TYPE_STRING |
static java.lang.String |
TYPE_STRING_CLASS |
static int |
TYPE_UNKNOWN |
| Constructor and Description |
|---|
ParameterValueManagement() |
| Modifier and Type | Method and Description |
|---|---|
static int |
childCount(ParameterValue pv,
java.lang.String childLocalName)
Returns the number of direct children of
pv with a local name of
childLocalName. |
static ParameterValue |
createElementValue(Element element)
Creates an XML instance document representation from a given XML Schema element.
|
static ParameterValue |
createElementValue(Element element,
Type instanceType) |
static IncomingAttachment |
getAttachment(ParameterValue rootParameter,
java.lang.String path)
Returns the value for a
AttachmentValue based parameter. |
static java.lang.String |
getAttachmentFilename(ParameterValue rootParameter)
Return the filename of the attachment.
|
static List |
getAttachments(ParameterValue rootParameter)
Returns a list of attachments from the given structure.
|
static java.lang.String |
getAttributeValue(ParameterValue rootParameterValue,
java.lang.String path,
QName attribute)
Returns the value of the attribute.
|
protected static List |
getChildren(ParameterValue wVal,
ParameterValue.ParameterPath pp) |
static QName |
getQName(ParameterValue rootParameter,
java.lang.String path)
Returns the value for a
QNameValue based parameter. |
static java.lang.String |
getString(ParameterValue rootParameterValue,
java.lang.String path)
Returns the value for a
StringValue based parameter. |
static boolean |
hasAttachment(ParameterValue pv)
Returns
true if any of the values (even the inner-elements) is an attachment,
false otherwise. |
static ParameterValue |
load(Type t) |
static java.lang.String |
register(Type type,
java.lang.String clazz)
Register a class for an XML Schema datatype
Type. |
static void |
removeAttachment(ParameterValue rootParameter)
Removes attachment from a given parameter.
|
static void |
setAttachment(ParameterValue rootParameter,
java.lang.String path,
Attachment attachment)
Sets the value for a
AttachmentValue based parameter. |
static void |
setAttachment(ParameterValue rootParameter,
java.lang.String path,
java.lang.String absoluteFilename,
ContentType contentType)
Creates new FileAttachment with the given filename.
|
static void |
setAttachmentScope(ParameterValue rootParameterValue,
java.lang.String uniqueId)
Sets the attachments scope for the given parameter and his children.
|
static void |
setAttributeValue(ParameterValue rootParameterValue,
java.lang.String path,
QName attribute,
java.lang.String value) |
static void |
setQName(ParameterValue rootParameter,
java.lang.String path,
QName value)
Sets the value for a
QNameValue based parameter. |
static void |
setString(ParameterValue rootParameterValue,
java.lang.String path,
java.lang.String value)
Sets the value for a
StringValue based parameter. |
static void |
setString(ParameterValue rootParameterValue,
java.lang.String path,
java.lang.String value,
Type instanceType)
Sets the value for a
StringValue based parameter. |
static java.lang.String |
unregister(Type type)
Unregister a class for an XML Schema datatype
Type. |
public static final boolean ALLOW_NOINDEX
public static final int TYPE_UNKNOWN
public static final int TYPE_COMPLEX
public static final int TYPE_STRING
public static final java.lang.String TYPE_STRING_CLASS
public static final int TYPE_ATTACHMENT
public static final java.lang.String TYPE_ATTACHMENT_CLASS
public static final int TYPE_QNAME
public static final java.lang.String TYPE_QNAME_CLASS
protected static final HashMap registeredValues
public static java.lang.String register(Type type, java.lang.String clazz)
Type.type - the type which should be used.clazz - the class which should be used to handle that type.public static java.lang.String unregister(Type type)
Type.type - the type which should be used.public static ParameterValue load(Type t)
public static java.lang.String getAttributeValue(ParameterValue rootParameterValue, java.lang.String path, QName attribute)
rootParameterValue - the parameter which should be used to get the attributes from, or should be used as parent.path - the path which should be used to get the child of the given parameter.attribute - the attribute.public static void setAttributeValue(ParameterValue rootParameterValue, java.lang.String path, QName attribute, java.lang.String value)
rootParameterValue - the parameter which should be used to get the attributes from, or should be used as parent.path - the path which should be used to get the child of the given parameter.attribute - the attribute.value - the attribute value.public static void setString(ParameterValue rootParameterValue, java.lang.String path, java.lang.String value)
StringValue based parameter.rootParameterValue - the parameter from type StringValue, or the parent of it.path - the path which allows to address a child of the given parameter.value - the value.public static void setString(ParameterValue rootParameterValue, java.lang.String path, java.lang.String value, Type instanceType)
StringValue based parameter. This Method can be used to set or
change the instance of the referenced child parameter according to instanceType.
ATTENTION: The instanceType of the root parameter can not be changed by this method.
rootParameterValue - the parameter from type StringValue, or the parent of it.path - the path which allows to address a child of the given parameter.value - the value.instanceType - the Type to be set for the referenced child parameter.public static java.lang.String getString(ParameterValue rootParameterValue, java.lang.String path)
StringValue based parameter.rootParameterValue - the parameter from type StringValue, or the parent of it.path - the path which allows to address a child of the given parameter.public static boolean hasAttachment(ParameterValue pv)
true if any of the values (even the inner-elements) is an attachment,
false otherwise.pv - the parameter which should be checked for attachments.true if any of the values (even the inner-elements) is an attachment, false
otherwise.public static void setAttachmentScope(ParameterValue rootParameterValue, java.lang.String uniqueId)
rootParameterValue - the parameter which should be used to set the scopeuniqueId - the attachment identifierpublic static List getAttachments(ParameterValue rootParameter)
rootParameter - the parameter which should be used to collect the attachments.public static java.lang.String getAttachmentFilename(ParameterValue rootParameter)
rootParameter - the parameter which should be used to determinate the filename.public static void removeAttachment(ParameterValue rootParameter)
rootParameter - the parameter which should get the attachment removed.public static void setAttachment(ParameterValue rootParameter, java.lang.String path, java.lang.String absoluteFilename, ContentType contentType)
rootParameter - the parameter which should be used to set the attachment to.absoluteFilename - filename of the attachment.public static IncomingAttachment getAttachment(ParameterValue rootParameter, java.lang.String path)
AttachmentValue based parameter.rootParameter - the parameter from type AttachmentValue, or the parent of it.path - the path which allows to address a child of the given parameter.public static void setAttachment(ParameterValue rootParameter, java.lang.String path, Attachment attachment)
AttachmentValue based parameter.rootParameter - the parameter from type AttachmentValue, or the parent of it.path - the path which allows to address a child of the given parameter.attachment - the attachment value.public static void setQName(ParameterValue rootParameter, java.lang.String path, QName value)
QNameValue based parameter.rootParameter - the parameter from type QNameValue, or the parent of it.path - the path which allows to address a child of the given parameter.value - the value.public static QName getQName(ParameterValue rootParameter, java.lang.String path)
QNameValue based parameter.rootParameter - the parameter from type QNameValue, or the parent of it.path - the path which allows to address a child of the given parameter.public static ParameterValue createElementValue(Element element)
element - the element to create the representation from.public static ParameterValue createElementValue(Element element, Type instanceType)
protected static List getChildren(ParameterValue wVal, ParameterValue.ParameterPath pp)
public static int childCount(ParameterValue pv, java.lang.String childLocalName)
pv with a local name of
childLocalName. Returns 0, if either pv or
childLocalName are null.pv - the parameter value instance, which of to count the direct children with the given local namechildLocalName - the local name of children to look forpv with the specified local name