com.ibm.websphere.sib.wsn
Class QueryExpression
- java.lang.Object
-
- com.ibm.websphere.sib.wsn.QueryExpression
-
public class QueryExpression extends java.lang.Object
This class represents the QueryExpressionType type from the WS-Notification Base Notification schema
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.net.URI
dialect
The Dialect for the expressionprotected javax.xml.soap.SOAPElement
expression
The contents of the expression if a single elementprotected ElementAndText
mixedExpression
The contents of the expression if a mixed single element and textprotected java.util.Map
prefixNSMappings
A map of prefixes to namespaces for prefixes used in the query expression.protected java.lang.String
textExpression
The contents of the expression if textstatic java.net.URI
XPATH_VERSION_1
The Dialect value for a XPath version 1.0 language as defined by W3 Org
-
Constructor Summary
Constructors Constructor and Description QueryExpression()
Default constructor.QueryExpression(java.net.URI dialect, ElementAndText mixed)
Construct an instance with the specified Dialect attribute value and mixed text and single element expression contentQueryExpression(java.net.URI dialect, ElementAndText mixed, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and mixed text and single element expression contentQueryExpression(java.net.URI dialect, javax.xml.soap.SOAPElement expression)
Construct an instance with the specified Dialect attribute value and single element only expression contentQueryExpression(java.net.URI dialect, javax.xml.soap.SOAPElement expression, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and single element only expression contentQueryExpression(java.net.URI dialect, java.lang.String text)
Construct an instance with the specified Dialect attribute value and text only expression content.QueryExpression(java.net.URI dialect, java.lang.String text, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and text only expression content.
-
Method Summary
Methods Modifier and Type Method and Description void
addPrefixMapping(java.lang.String prefix, java.lang.String namespace)
Add a mapping between a prefix and a namespace.java.net.URI
getDialect()
Get the value of the Dialect attribute for the expressionjavax.xml.soap.SOAPElement
getExpressionContents()
Get the contents of the expression as a SOAPElement.ElementAndText
getExpressionContentsIfMixed()
Get the contents of the expression as a mixture of text and a single element.java.lang.String
getExpressionContentsIfText()
Get the contents of the expression as text.java.lang.String
getNamespaceForPrefix(java.lang.String prefix)
Get the namespace for a given prefix defined for this topic expressionjava.util.Iterator
getNamespacePrefixes()
Get an iterator over all the prefix values defined in the prefix to namespace mapjava.util.Map
getNamespacePrefixesMap()
Get the prefix to namespace mapvoid
setDialect(java.net.URI dialect)
Set the value of the Dialect attribute for the expression.void
setExpressionContents(javax.xml.soap.SOAPElement expression)
Set the contents of the expression as a SOAPElement.void
setExpressionContentsAsMixed(ElementAndText mixed)
Set the contents of the expression as a SOAPElement.void
setExpressionContentsAsText(java.lang.String text)
Set the contents of the expression as text.
-
-
-
Field Detail
-
XPATH_VERSION_1
public static final java.net.URI XPATH_VERSION_1
The Dialect value for a XPath version 1.0 language as defined by W3 Org
-
dialect
protected java.net.URI dialect
The Dialect for the expression
-
expression
protected javax.xml.soap.SOAPElement expression
The contents of the expression if a single element
-
textExpression
protected java.lang.String textExpression
The contents of the expression if text
-
mixedExpression
protected ElementAndText mixedExpression
The contents of the expression if a mixed single element and text
-
prefixNSMappings
protected java.util.Map prefixNSMappings
A map of prefixes to namespaces for prefixes used in the query expression. The keys and values in the map are Strings.
-
-
Constructor Detail
-
QueryExpression
public QueryExpression()
Default constructor. If this constructor is used, it will be necessary to make a subsequent call tosetDialect(URI)
to set the required Dialect value.
-
QueryExpression
public QueryExpression(java.net.URI dialect, java.lang.String text)
Construct an instance with the specified Dialect attribute value and text only expression content.- Parameters:
dialect
- The Dialect attribute value for the expressiontext
- The text only expression content
-
QueryExpression
public QueryExpression(java.net.URI dialect, java.lang.String text, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and text only expression content.- Parameters:
dialect
- The Dialect attribute value for the expressiontext
- The text only expression contentprefixToNamespaceMappings
- A String (key) to String (value) map of prefix names to their corresponding namespaces. Such mappings may be required for text only expressions
-
QueryExpression
public QueryExpression(java.net.URI dialect, javax.xml.soap.SOAPElement expression)
Construct an instance with the specified Dialect attribute value and single element only expression content- Parameters:
dialect
- The Dialect attribute value for the expressionexpression
- The expression content
-
QueryExpression
public QueryExpression(java.net.URI dialect, javax.xml.soap.SOAPElement expression, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and single element only expression content- Parameters:
dialect
- The Dialect attribute value for the expressionexpression
- The expression contentprefixToNamespaceMappings
- A String (key) to String (value) map of prefix names to their corresponding namespaces. Such mappings may be required for text only expressions
-
QueryExpression
public QueryExpression(java.net.URI dialect, ElementAndText mixed)
Construct an instance with the specified Dialect attribute value and mixed text and single element expression content- Parameters:
dialect
- The Dialect attribute value for the expressionmixed
- The mixed expression content- See Also:
ElementAndText
-
QueryExpression
public QueryExpression(java.net.URI dialect, ElementAndText mixed, java.util.Map prefixToNamespaceMappings)
Construct an instance with the specified Dialect attribute value and mixed text and single element expression content- Parameters:
dialect
- The Dialect attribute value for the expressionmixed
- The mixed expression contentprefixToNamespaceMappings
- A String (key) to String (value) map of prefix names to their corresponding namespaces. Such mappings may be required for text only expressions- See Also:
ElementAndText
-
-
Method Detail
-
getDialect
public java.net.URI getDialect()
Get the value of the Dialect attribute for the expression- Returns:
- The Dialect
-
setDialect
public void setDialect(java.net.URI dialect)
Set the value of the Dialect attribute for the expression.- Parameters:
dialect
- The Dialect
-
getExpressionContents
public javax.xml.soap.SOAPElement getExpressionContents()
Get the contents of the expression as a SOAPElement. If the content was specified as text or as a mixture of text and element, this method will return null.- Returns:
- The expression contents
-
setExpressionContents
public void setExpressionContents(javax.xml.soap.SOAPElement expression)
Set the contents of the expression as a SOAPElement. Any content previously set either as text, element or a mixture will be removed.- Parameters:
expression
- The contents of the expression as a single element
-
getExpressionContentsIfText
public java.lang.String getExpressionContentsIfText()
Get the contents of the expression as text. If the content was specified as an element or as a mixture of text and element, this method will return null.- Returns:
- The expression contents as text
-
setExpressionContentsAsText
public void setExpressionContentsAsText(java.lang.String text)
Set the contents of the expression as text. Any content previously set either as text, element or a mixture will be removed.- Parameters:
text
- The contents of the expression as text only
-
getExpressionContentsIfMixed
public ElementAndText getExpressionContentsIfMixed()
Get the contents of the expression as a mixture of text and a single element. If the content was specified as text only or element only, this method will return null.- Returns:
- The expression contents as mixed text and element
- See Also:
ElementAndText
-
setExpressionContentsAsMixed
public void setExpressionContentsAsMixed(ElementAndText mixed)
Set the contents of the expression as a SOAPElement. Any content previously set either as text, element or a mixture will be removed.- Parameters:
mixed
- The contents of the expression as mixed text and element- See Also:
ElementAndText
-
getNamespacePrefixes
public java.util.Iterator getNamespacePrefixes()
Get an iterator over all the prefix values defined in the prefix to namespace map- Returns:
- An iterator of the prefixes defined in the prefix to namespace map
-
getNamespacePrefixesMap
public java.util.Map getNamespacePrefixesMap()
Get the prefix to namespace map- Returns:
- The prefix to namespace map
-
getNamespaceForPrefix
public java.lang.String getNamespaceForPrefix(java.lang.String prefix)
Get the namespace for a given prefix defined for this topic expression- Parameters:
prefix
- The prefix for which the namespace is required- Returns:
- The namespace corresponding to the prefix or null if no corresponding namespace exists
-
addPrefixMapping
public void addPrefixMapping(java.lang.String prefix, java.lang.String namespace)
Add a mapping between a prefix and a namespace.- Parameters:
prefix
- The prefixnamespace
- The namespace corresponding to the prefix
-
-