com.codestreet.selector.parser
Class Identifier

java.lang.Object
  extended bycom.codestreet.selector.parser.Identifier
All Implemented Interfaces:
IExpression

public final class Identifier
extends java.lang.Object
implements IExpression

Class to represent an identifier. Thread safe class may be freely used across threads. Identifiers can either be JMS header fields, or JMS provider-specific properties, or application properties.

The following JMS header fields are supported: JMSDeliveryMode, JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and JMSType. In addition, the header fields JMSRedelivered and JMSExpiration are also supported. These additional fields are relevant only for the receiving application and not for the sender.

Support is provided for nested fields. Nested fields are referenced using a dot notation. For example, order.quantity would select the quantity field of the nested sub-message field order if it exists. Otherwise, it selects nothing (null).

Author:
Jawaid Hakim.

Method Summary
 java.lang.Object eval(IValueProvider provider, java.lang.Object corr)
          Evaluate the expression.
 java.lang.Object eval(java.util.Map identifiers)
          Evaluate the expression.
 java.lang.String getIdentifier()
          Get identifier name.
 boolean isJMSHeader()
          Check if this is a JMS header property.
 java.lang.String toString()
           
static Identifier valueOf(java.lang.String id)
          Factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

valueOf

public static Identifier valueOf(java.lang.String id)
Factory.

Parameters:
id - Identifier name.
Returns:
Instance.
Throws:
java.lang.IllegalArgumentException - Invalid identifier name.

getIdentifier

public java.lang.String getIdentifier()
Get identifier name.

Returns:
Identifier name.

isJMSHeader

public boolean isJMSHeader()
Check if this is a JMS header property.

Returns:
true if this identifier is a JMS header property. Otherwise, returns false.

eval

public java.lang.Object eval(java.util.Map identifiers)
Description copied from interface: IExpression
Evaluate the expression.

Specified by:
eval in interface IExpression
Parameters:
identifiers - Identifier values.
Returns:
Result of the expression evaluation.

eval

public java.lang.Object eval(IValueProvider provider,
                             java.lang.Object corr)
Description copied from interface: IExpression
Evaluate the expression.

Specified by:
eval in interface IExpression
Parameters:
provider - Value provider. During evaluation of the expression callbacks are made on the value provider to get identifier values.
corr - Correlation data. Passed as-is to the value provider.
Returns:
Result evaluating the expression.

toString

public java.lang.String toString()


Copyright © 2002-2006 CodeStreet. All Rights Reserved.