public class OccurrencesRestrictionFactory extends Object implements OptionRestrictionFactory, ArgumentsRestrictionFactory
To more finely control the number of occurrences of an option use
MinOccurrences and MaxOccurrences. If you simply wish to
state that an option must occur then use Required.
| Constructor and Description |
|---|
OccurrencesRestrictionFactory() |
| Modifier and Type | Method and Description |
|---|---|
ArgumentsRestriction |
createArgumentsRestriction(Annotation annotation)
Tries to create an arguments restriction from the given annotation
|
protected OccurrencesRestriction |
createCommon(Annotation annotation) |
OptionRestriction |
createOptionRestriction(Annotation annotation)
Try and create an option restriction from the given annotation
|
protected List<Class<? extends Annotation>> |
supportedAnnotations() |
List<Class<? extends Annotation>> |
supportedArgumentsAnnotations()
Gets a list of annotations that this factory can convert into arguments
restrictions
|
List<Class<? extends Annotation>> |
supportedOptionAnnotations()
Gets a list of annotations that this factory can convert into option
restrictions
|
public ArgumentsRestriction createArgumentsRestriction(Annotation annotation)
ArgumentsRestrictionFactorycreateArgumentsRestriction in interface ArgumentsRestrictionFactoryannotation - Annotationnull if this factory cannot
create a restriction from the given annotationpublic OptionRestriction createOptionRestriction(Annotation annotation)
OptionRestrictionFactorycreateOptionRestriction in interface OptionRestrictionFactoryannotation - Annotationnull if this factory cannot create
a restriction from the given annotationprotected OccurrencesRestriction createCommon(Annotation annotation)
protected List<Class<? extends Annotation>> supportedAnnotations()
public List<Class<? extends Annotation>> supportedArgumentsAnnotations()
ArgumentsRestrictionFactorysupportedArgumentsAnnotations in interface ArgumentsRestrictionFactorypublic List<Class<? extends Annotation>> supportedOptionAnnotations()
OptionRestrictionFactorysupportedOptionAnnotations in interface OptionRestrictionFactoryCopyright © 2012–2022. All rights reserved.