Package org.marketcetera.util.ws.tags
Class EqualsTagFilter
- java.lang.Object
-
- org.marketcetera.util.ws.tags.EqualsTagFilter
-
- All Implemented Interfaces:
TagFilter
public class EqualsTagFilter extends Object implements TagFilter
A tag filter that accepts any tag that is equal to a specific target tag (which may be the null tag). The message for the exception thrown when the filter rejects a candidate tag is configurable, and receives as parameters the target and (failed) candidate tag.- Since:
- 1.0.0
- Version:
- $Id: EqualsTagFilter.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Field Summary
Fields Modifier and Type Field Description private I18NMessage2PmMessageprivate TagmTarget
-
Constructor Summary
Constructors Constructor Description EqualsTagFilter(Tag target, I18NMessage2P message)Creates a new filter with the given target tag and mismatch message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertMatch(Tag tag)Asserts that the given tag is acceptable to the receiver.I18NMessage2PgetMessage()Returns the message for the exception thrown when the receiver filter rejects a tag.TaggetTarget()Returns the receiver's target tag.
-
-
-
Field Detail
-
mTarget
private final Tag mTarget
-
mMessage
private final I18NMessage2P mMessage
-
-
Constructor Detail
-
EqualsTagFilter
public EqualsTagFilter(Tag target, I18NMessage2P message)
Creates a new filter with the given target tag and mismatch message.- Parameters:
target- The target tag. It may be null.message- The message for the exception thrown when the filter rejects a tag.
-
-
Method Detail
-
getTarget
public Tag getTarget()
Returns the receiver's target tag.- Returns:
- The tag, which may be null.
-
getMessage
public I18NMessage2P getMessage()
Returns the message for the exception thrown when the receiver filter rejects a tag.- Returns:
- The message.
-
assertMatch
public void assertMatch(Tag tag) throws I18NException
Description copied from interface:TagFilterAsserts that the given tag is acceptable to the receiver.- Specified by:
assertMatchin interfaceTagFilter- Throws:
I18NException- Thrown if the tag is not acceptable.
-
-