ca.infoway.messagebuilder.xml
Class ChoiceSupport

Package class diagram package ChoiceSupport
java.lang.Object
  extended by ca.infoway.messagebuilder.xml.ChoiceSupport
Direct Known Subclasses:
Argument, Relationship

public abstract class ChoiceSupport
extends Object

A base class for types that support choices.

Author:
Intelliware Development

Constructor Summary
ChoiceSupport()
           
 
Method Summary
static Predicate<Relationship> choiceOptionNamePredicate(String relationshipName)
          A convenience utility to create a predicate that finds a specific choice based on the name of the XML element.
static Predicate<Relationship> choiceOptionTypePredicate(String[] relationshipTypes)
          A convenience utility to create a predicate that finds a specific choice based on the part type (or part types).
 Relationship findChoiceOption(Predicate<Relationship> predicate)
          Find a specific choice based on some matching strategy defined by the predicate.
abstract  List<Relationship> getChoices()
          Get the list of choices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceSupport

public ChoiceSupport()
Method Detail

findChoiceOption

public Relationship findChoiceOption(Predicate<Relationship> predicate)

Find a specific choice based on some matching strategy defined by the predicate.

Parameters:
predicate - - a class that determines the matching strategy of the choice.
Returns:
the selected choice.

getChoices

public abstract List<Relationship> getChoices()

Get the list of choices.

Returns:
the list of choices.

choiceOptionNamePredicate

public static Predicate<Relationship> choiceOptionNamePredicate(String relationshipName)

A convenience utility to create a predicate that finds a specific choice based on the name of the XML element.

Parameters:
relationshipName - - the name of the XML element on the incoming message
Returns:
the corresponding choice.

choiceOptionTypePredicate

public static Predicate<Relationship> choiceOptionTypePredicate(String[] relationshipTypes)

A convenience utility to create a predicate that finds a specific choice based on the part type (or part types).

Parameters:
relationshipTypes - - the part types (typically taken from a part type mapping)
Returns:
the corresponding choice.


Copyright © 2013. All Rights Reserved.