org.outerj.daisy.frontend
Class KeySetParser

java.lang.Object
  extended by org.outerj.daisy.frontend.KeySetParser

public class KeySetParser
extends java.lang.Object

This class provides utility methods for creating widget validators and parsing input for a specific type of input whereby the entered data consists of lines following an "item,branch,language" pattern. Since the same algorithm is needed in slightly different ways on different locations, this class generalises all the use cases to avoid code duplication.


Constructor Summary
KeySetParser()
           
 
Method Summary
static WidgetValidator getCollectionSubscriptionKeysWidgetValidator(org.outerj.daisy.repository.Repository repository, boolean allowWildcards, boolean needAtLeastOne)
           
static WidgetValidator getVariantKeysWidgetValidator(org.outerj.daisy.repository.variant.VariantManager variantManager, boolean allowWildcards, boolean needAtLeastOne)
           
static org.outerj.daisy.emailnotifier.CollectionSubscriptionKey[] parseCollectionKeys(java.lang.String input, org.outerj.daisy.repository.Repository repository)
           
static org.outerj.daisy.repository.VariantKey[] parseVariantKeys(java.lang.String input, org.outerj.daisy.repository.variant.VariantManager variantManager, boolean allowWildcards, boolean needAtLeastOne)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeySetParser

public KeySetParser()
Method Detail

parseVariantKeys

public static org.outerj.daisy.repository.VariantKey[] parseVariantKeys(java.lang.String input,
                                                                        org.outerj.daisy.repository.variant.VariantManager variantManager,
                                                                        boolean allowWildcards,
                                                                        boolean needAtLeastOne)
                                                                 throws java.lang.Exception
Parameters:
allowWildcards - if true, then each of the components on a line can be a star (*). In this case branch and language must be specified, while if this parameter is false branch and language do not have to be specified and 1 will be taken as default. An input of * will be translated to -1 when parsing.
needAtLeastOne - at least one entry is needed, otherwise an error will be raised
Throws:
java.lang.Exception

parseCollectionKeys

public static org.outerj.daisy.emailnotifier.CollectionSubscriptionKey[] parseCollectionKeys(java.lang.String input,
                                                                                             org.outerj.daisy.repository.Repository repository)
                                                                                      throws java.lang.Exception
Throws:
java.lang.Exception

getVariantKeysWidgetValidator

public static WidgetValidator getVariantKeysWidgetValidator(org.outerj.daisy.repository.variant.VariantManager variantManager,
                                                            boolean allowWildcards,
                                                            boolean needAtLeastOne)

getCollectionSubscriptionKeysWidgetValidator

public static WidgetValidator getCollectionSubscriptionKeysWidgetValidator(org.outerj.daisy.repository.Repository repository,
                                                                           boolean allowWildcards,
                                                                           boolean needAtLeastOne)


Copyright © -2006 . All Rights Reserved.