|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ws4d.java.util.ParameterUtil
public class ParameterUtil
Utility class for easier parameter handling.
This class implements methods for parameters based on the default
implementation inside the framework. It allows to handle
AttachmentValue
and StringValue
as before.
Constructor Summary | |
---|---|
ParameterUtil()
|
Method Summary | |
---|---|
static IncomingAttachment |
getAttachment(ParameterValue wVal,
java.lang.String path)
Returns the value for a AttachmentValue based parameter. |
static java.lang.String |
getAttachmentFilename(ParameterValue wVal)
Return the filename of the attachment. |
static List |
getAttachments(ParameterValue wVal)
Returns a list of attachments from the given structure. |
static java.lang.String |
getAttributeValue(ParameterValue wVal,
java.lang.String path,
java.lang.String attribute)
Returns the value of the attribute. |
static QName |
getQName(ParameterValue wVal,
java.lang.String path)
Returns the value for a QNameValue based parameter. |
static java.lang.String |
getString(ParameterValue wVal,
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 void |
removeAttachment(ParameterValue wVal)
Removes attachment from a given parameter. |
static void |
setAttachment(ParameterValue wVal,
java.lang.String filename)
Creates new FileAttachment with the given filename. |
static void |
setAttachment(ParameterValue wVal,
java.lang.String path,
Attachment attachment)
Sets the value for a AttachmentValue based parameter. |
static void |
setAttachmentScope(ParameterValue wVal,
ContextID context)
Sets the attachments scope for the given parameter and his children. |
static void |
setAttributeValue(ParameterValue wVal,
java.lang.String path,
java.lang.String attribute,
java.lang.String value)
|
static void |
setQName(ParameterValue wVal,
java.lang.String path,
QName value)
Sets the value for a QNameValue based parameter. |
static void |
setString(ParameterValue wVal,
java.lang.String path,
java.lang.String value)
Sets the value for a StringValue based parameter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParameterUtil()
Method Detail |
---|
public static java.lang.String getAttributeValue(ParameterValue wVal, java.lang.String path, java.lang.String attribute)
wVal
- 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 wVal, java.lang.String path, java.lang.String attribute, java.lang.String value)
wVal
- 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 wVal, java.lang.String path, java.lang.String value)
StringValue
based parameter.
wVal
- 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 java.lang.String getString(ParameterValue wVal, java.lang.String path)
StringValue
based parameter.
wVal
- 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 wVal, ContextID context)
wVal
- the parameter which should be used to set the scopecontext
- the MIME context identifier.public static List getAttachments(ParameterValue wVal)
wVal
- the parameter which should be used to collect the
attachments.
public static java.lang.String getAttachmentFilename(ParameterValue wVal)
FileAttachment
)
wVal
- the parameter which should be used to determinate the
filename.
FileAttachment
else nullpublic static void removeAttachment(ParameterValue wVal)
wVal
- the parameter which should get the attachment removed.public static void setAttachment(ParameterValue wVal, java.lang.String filename)
wVal
- the parameter which should be used to set the attachment to.filename
- filename of the attachment.public static IncomingAttachment getAttachment(ParameterValue wVal, java.lang.String path)
AttachmentValue
based parameter.
wVal
- 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 wVal, java.lang.String path, Attachment attachment)
AttachmentValue
based parameter.
wVal
- the parameter from type AttachmentValue
, or the
parent of it.path
- the path which allows to address a child of the given
parameter.value
- the value.public static void setQName(ParameterValue wVal, java.lang.String path, QName value)
QNameValue
based parameter.
wVal
- 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 wVal, java.lang.String path)
QNameValue
based parameter.
wVal
- the parameter from type QNameValue
, or the parent of
it.path
- the path which allows to address a child of the given
parameter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |