com.ibm.websphere.sib.wsn

Class TopicExpression

  1. java.lang.Object
  2. extended bycom.ibm.websphere.sib.wsn.TopicExpression

  1. public class TopicExpression
  2. extends java.lang.Object
This class represents the TopicExpressionType type from the WS-Notification Base Notification schema

Field Summary

Modifier and Type Field and Description
  1. protected
  2. java.util.Map
attributes
A map of custom attributes set on the topic expression element.
  1. static
  2. java.net.URI
CONCRETE_TOPIC_PATH_EXPRESSION
The Dialect value for a concrete topic path expression as defined by WS-Topics
  1. protected
  2. java.net.URI
dialect
The topic Dialect
  1. protected
  2. javax.xml.soap.SOAPElement
elementContent
The value of the topic expression content if the value is an element
  1. static
  2. java.net.URI
FULL_TOPIC_PATH_EXPRESSION
The Dialect value for a fulle topic path expression as defined by WS-Topics
  1. protected
  2. ElementAndText
mixedContent
The value of the topic expression content if value is mixed text and element
  1. protected
  2. java.util.Map
prefixNSMappings
A map of prefixes to namespaces for prefixes used in the topic expression.
  1. static
  2. java.net.URI
SIMPLE_TOPIC_EXPRESSION
The Dialect value for a simple topic expression as defined by WS-Topics
  1. protected
  2. java.lang.String
topic
The value of the topic expression content if the value is text only

Constructor Summary

Constructor and Description
TopicExpression()
Default constructor.
TopicExpression(java.net.URI dialect,ElementAndText mixed)
Create a topic expression with a mixed text and single element content value
TopicExpression(java.net.URI dialect,ElementAndText mixed,java.util.Map prefixToNamespaceMappings)
Create a topic expression with a mixed text and single element content value
TopicExpression(java.net.URI dialect,javax.xml.soap.SOAPElement element)
Create a topic expression with a single element content value
TopicExpression(java.net.URI dialect,javax.xml.soap.SOAPElement element,java.util.Map prefixToNamespaceMappings)
Create a topic expression with a single element content value
TopicExpression(java.net.URI dialect,java.lang.String topic)
Create a topic expression with a text only content value
TopicExpression(java.net.URI dialect,java.lang.String topic,java.util.Map prefixToNamespaceMappings)
Create a topic expression with a text only content value

Method Summary

Modifier and Type Method and Description
  1. void
addAttribute(javax.xml.soap.Name name,java.lang.String value)
Add a custom attribute to the topic expression
  1. void
addPrefixMapping(java.lang.String prefix,java.lang.String namespace)
Add a mapping between a prefix and a namespace.
  1. boolean
equals(java.lang.Object obj)
  1. java.util.Iterator
getAttributes()
Get the names of the custom attributes defined on the topic expression.
  1. java.lang.String
getAttributeValue(javax.xml.soap.Name name)
Get the value for a custom attribute.
  1. java.net.URI
getDialect()
Get the Dialect value of this topic expression
  1. java.lang.String
getNamespaceForPrefix(java.lang.String prefix)
Get the namespace for a given prefix defined for this topic expression
  1. java.util.Iterator
getNamespacePrefixes()
Get an iterator over all the prefix values defined in the prefix to namespace map
  1. java.util.Map
getNamespacePrefixesMap()
Get the prefix to namespace map
  1. java.lang.String
getTopic()
Get the contents of the topic expression as text (String).
  1. javax.xml.soap.SOAPElement
getTopicIfElement()
Get the contents of the topic expression as a element.
  1. ElementAndText
getTopicIfMixed()
Get the contents of the topic expression as a mixture of text and a single element.
  1. int
hashCode()
  1. void
setDialect(java.net.URI uri)
Set the Dialect value of this topic expression.
  1. void
setTopic(java.lang.String topic,java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as text.
  1. void
setTopicAsElement(javax.xml.soap.SOAPElement element,java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as an element.
  1. void
setTopicAsMixed(ElementAndText mixed,java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as a mixture of text and a single element.
  1. java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

SIMPLE_TOPIC_EXPRESSION

  1. public static final java.net.URI SIMPLE_TOPIC_EXPRESSION
The Dialect value for a simple topic expression as defined by WS-Topics

CONCRETE_TOPIC_PATH_EXPRESSION

  1. public static final java.net.URI CONCRETE_TOPIC_PATH_EXPRESSION
The Dialect value for a concrete topic path expression as defined by WS-Topics

FULL_TOPIC_PATH_EXPRESSION

  1. public static final java.net.URI FULL_TOPIC_PATH_EXPRESSION
The Dialect value for a fulle topic path expression as defined by WS-Topics

dialect

  1. protected java.net.URI dialect
The topic Dialect

topic

  1. protected java.lang.String topic
The value of the topic expression content if the value is text only

elementContent

  1. protected javax.xml.soap.SOAPElement elementContent
The value of the topic expression content if the value is an element

mixedContent

  1. protected ElementAndText mixedContent
The value of the topic expression content if value is mixed text and element

prefixNSMappings

  1. protected java.util.Map prefixNSMappings
A map of prefixes to namespaces for prefixes used in the topic expression. The keys and values in the map are Strings.

attributes

  1. protected java.util.Map attributes
A map of custom attributes set on the topic expression element. The keys are javax.xml.soap.Name objects and the values are Strings.

Constructor Detail

TopicExpression

  1. public TopicExpression()
Default constructor. If this constructor is used, it will be necessary to make a subsequent call to setDialect(URI) to set the required Dialect value in order to produce a valid expression.

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. java.lang.String topic)
Create a topic expression with a text only content value
Parameters:
dialect - The topic expression dialect. Three standard values are defined
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple for simple topic expressions
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete for concrete topic path expressions
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Full for full topic path expressions
topic - The contents of the topic expression in a format which is valid for the specified dialect

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. java.lang.String topic,
  3. java.util.Map prefixToNamespaceMappings)
Create a topic expression with a text only content value
Parameters:
dialect - The topic expression dialect. Three standard values are defined
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple for simple topic expressions
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete for concrete topic path expressions
  • http://docs.oasis-open.org/wsn/t-1/TopicExpression/Full for full topic path expressions
topic - The contents of the topic expression in a format which is valid for the specified dialect
prefixToNamespaceMappings - A String (key) to String (value) map of prefix names to their corresponding namespaces. Such mappings are required for expressions belonging to one of the three standard dialects. A mapping should be specified for each prefix used in the topic expression content.

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. javax.xml.soap.SOAPElement element)
Create a topic expression with a single element content value
Parameters:
dialect - The topic expression dialect.
element - The contents of the topic expression as a single element. This format must valid for the specified dialect

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. javax.xml.soap.SOAPElement element,
  3. java.util.Map prefixToNamespaceMappings)
Create a topic expression with a single element content value
Parameters:
dialect - The topic expression dialect.
element - The contents of the topic expression as a single element. This format must valid for the specified dialect
prefixToNamespaceMappings - (optional) A String (key) to String (value) map of prefix names to their corresponding namespaces. Mappings need to be specified for each prefix which is used but not declared within the topic expression content.

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. ElementAndText mixed)
Create a topic expression with a mixed text and single element content value
Parameters:
dialect - The topic expression dialect.
mixed - The contents of the topic expression as a mixture of text and a single element. This format must valid for the specified dialect
See Also:

TopicExpression

  1. public TopicExpression(java.net.URI dialect,
  2. ElementAndText mixed,
  3. java.util.Map prefixToNamespaceMappings)
Create a topic expression with a mixed text and single element content value
Parameters:
dialect - The topic expression dialect.
mixed - The contents of the topic expression as a mixture of text and a single element. This format must valid for the specified dialect
prefixToNamespaceMappings - (optional) A String (key) to String (value) map of prefix names to their corresponding namespaces. Mappings need to be specified for each prefix which is used but not declared within the topic expression content.
See Also:

Method Detail

getDialect

  1. public java.net.URI getDialect( )
Get the Dialect value of this topic expression
Returns:
The topic expression dialect

setDialect

  1. public void setDialect(java.net.URI uri)
Set the Dialect value of this topic expression.
Parameters:
uri - The topic expression dialect

getTopic

  1. public java.lang.String getTopic( )
Get the contents of the topic expression as text (String). If the contents were specified as an element or mixed of text and element, this method will return null.
Returns:
The topic expression content or null if text only content does not exist.

setTopic

  1. public void setTopic(java.lang.String topic,
  2. java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as text. Any content previously set either as text, element or a mixture will be removed. A text (String) value should be used if the topic dialect is one of the three standard dialects - simple, concrete or full.
Parameters:
topic - The topic expression content
prefixToNamespaceMappings - A String (key) to String (value) map of prefix names to their corresponding namespaces. Mappings need to be specified for each prefix used in the topic expression content

getTopicIfElement

  1. public javax.xml.soap.SOAPElement getTopicIfElement( )
Get the contents of the topic expression as a element. If the contents were specified as text or mixed of text and element, this method will return null.
Returns:
The topic expression contents as an element or null if element content does not exist.

setTopicAsElement

  1. public void setTopicAsElement(javax.xml.soap.SOAPElement element,
  2. java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as an element. Any content previously set either as text, element or a mixture will be removed.
Parameters:
element - The topic expression content as a SOAPElement
prefixToNamespaceMappings - (optional) A String (key) to String (value) map of prefix names to their corresponding namespaces. Mappings need to be specified for each prefix which is used but not declared within the topic expression content.

getTopicIfMixed

  1. public ElementAndText getTopicIfMixed( )
Get the contents of the topic expression as a mixture of text and a single element. If the contents were specified as text or mixed of text and element, this method will return null.
Returns:
The topic expression contents as an mixture of text and a single element or null if mixed content does not exist.
See Also:

setTopicAsMixed

  1. public void setTopicAsMixed(ElementAndText mixed,
  2. java.util.Map prefixToNamespaceMappings)
Set the contents of the topic expression as a mixture of text and a single element. Any content previously set either as text, element or a mixture will be removed.
Parameters:
mixed - The topic expression content as a mixture of text and an element
prefixToNamespaceMappings - (optional) A String (key) to String (value) map of prefix names to their corresponding namespaces. Mappings need to be specified for each prefix which is used but not declared within the topic expression content.
See Also:

getNamespacePrefixes

  1. 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

  1. public java.util.Map getNamespacePrefixesMap( )
Get the prefix to namespace map
Returns:
The prefix to namespace map

getNamespaceForPrefix

  1. 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

  1. public void addPrefixMapping(java.lang.String prefix,
  2. java.lang.String namespace)
Add a mapping between a prefix and a namespace.
Parameters:
prefix - The prefix
namespace - The namespace corresponding to the prefix

addAttribute

  1. public void addAttribute(javax.xml.soap.Name name,
  2. java.lang.String value)
  3. throws java.lang.Exception
Add a custom attribute to the topic expression
Parameters:
name - The name of the custom attribute
value - The value of the custom attribute
Throws:
java.lang.Exception

getAttributes

  1. public java.util.Iterator getAttributes( )
Get the names of the custom attributes defined on the topic expression. This does not include the Dialect attribute. To get the Dialect use @see #getDialect()
Returns:
An iterator over the names of the custom attributes

getAttributeValue

  1. public java.lang.String getAttributeValue( javax.xml.soap.Name name)
Get the value for a custom attribute. To get the Dialect use @see #getDialect()
Parameters:
name - The name of the custom attribute
Returns:
The value of the custom attribute

hashCode

  1. public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

  1. public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()