Package org.jboss.as.controller
Class ListAttributeDefinition.Builder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition>
- java.lang.Object
-
- org.jboss.as.controller.AbstractAttributeDefinitionBuilder<BUILDER,ATTRIBUTE>
-
- org.jboss.as.controller.ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>
-
- Direct Known Subclasses:
ObjectListAttributeDefinition.Builder,PrimitiveListAttributeDefinition.Builder,SimpleListAttributeDefinition.Builder,StringListAttributeDefinition.Builder
- Enclosing class:
- ListAttributeDefinition
public abstract static class ListAttributeDefinition.Builder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition> extends AbstractAttributeDefinitionBuilder<BUILDER,ATTRIBUTE>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder(String attributeName)protectedBuilder(String attributeName, boolean optional)Builder(String attributeName, ListAttributeDefinition basis)Builder(ListAttributeDefinition basis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetAllowNullElement()Gets whether undefined list elements are valid.ParameterValidatorgetElementValidator()Gets the validator to use for validating list elements.intgetMaxSize()intgetMinSize()ParameterValidatorgetValidator()BUILDERsetAllowDuplicates(boolean allowDuplicates)toggles default validator strategy to allow / not allow duplicate elements in listBUILDERsetAllowNullElement(boolean allowNullElement)Sets whether undefined list elements are valid.BUILDERsetElementValidator(ParameterValidator elementValidator)Sets the validator to use for validating list elements.BUILDERsetListValidator(ParameterValidator validator)Sets an overall validator for the list.BUILDERsetValidator(ParameterValidator validator)Overrides the superclass to simply delegate tosetElementValidator(org.jboss.as.controller.operations.validation.ParameterValidator).-
Methods inherited from class org.jboss.as.controller.AbstractAttributeDefinitionBuilder
addAccessConstraint, addAlternatives, addArbitraryDescriptor, addFlag, build, getAccessConstraints, getAllowedValues, getAlternatives, getArbitraryDescriptors, getAttributeGroup, getAttributeMarshaller, getCapabilityReferenceRecorder, getCorrector, getDefaultValue, getDeprecated, getFlags, getMeasurementUnit, getName, getNullSignificant, getParser, getRequires, getStability, getType, getUndefinedMetricValue, getXmlName, isAllowExpression, isFlagPresent, isNillable, isResourceOnly, removeAlternatives, removeFlag, setAccessConstraints, setAllowedValues, setAllowedValues, setAllowedValues, setAllowExpression, setAlternatives, setAttributeGroup, setAttributeMarshaller, setAttributeParser, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCorrector, setDefaultValue, setDeprecated, setDeprecated, setExpressionsDeprecated, setFlags, setMaxSize, setMeasurementUnit, setMinSize, setNullSignificant, setRequired, setRequires, setResourceOnly, setRestartAllServices, setRestartJVM, setRuntimeServiceNotRequired, setStability, setStorageRuntime, setUndefinedMetricValue, setXmlName
-
-
-
-
Constructor Detail
-
Builder
protected Builder(String attributeName)
-
Builder
protected Builder(String attributeName, boolean optional)
-
Builder
public Builder(ListAttributeDefinition basis)
-
Builder
public Builder(String attributeName, ListAttributeDefinition basis)
-
-
Method Detail
-
getElementValidator
public ParameterValidator getElementValidator()
Gets the validator to use for validating list elements. En- Returns:
- the validator, or
nullif no validator has been set
-
setElementValidator
public final BUILDER setElementValidator(ParameterValidator elementValidator)
Sets the validator to use for validating list elements.- Parameters:
elementValidator- the validator- Returns:
- a builder that can be used to continue building the attribute definition
- Throws:
IllegalArgumentException- ifelementValidatorisnull
-
setValidator
public BUILDER setValidator(ParameterValidator validator)
Overrides the superclass to simply delegate tosetElementValidator(org.jboss.as.controller.operations.validation.ParameterValidator). UsesetListValidator(org.jboss.as.controller.operations.validation.ParameterValidator)to set an overall validator for the list.- Overrides:
setValidatorin classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition>- Parameters:
validator- the validator. Cannot benull- Returns:
- a builder that can be used to continue building the attribute definition
- Throws:
IllegalArgumentException- ifelementValidatorisnull
-
setListValidator
public BUILDER setListValidator(ParameterValidator validator)
Sets an overall validator for the list.- Parameters:
validator- the validator.nullis allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
getMinSize
public int getMinSize()
- Overrides:
getMinSizein classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition>
-
getMaxSize
public int getMaxSize()
- Overrides:
getMaxSizein classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition>
-
getAllowNullElement
public boolean getAllowNullElement()
Gets whether undefined list elements are valid. In the unlikely casesetAllowNullElement(boolean)has been called, that value is returned; otherwise the value ofAbstractAttributeDefinitionBuilder.isNillable()is used.- Returns:
trueif undefined list elements are valid
-
setAllowNullElement
public BUILDER setAllowNullElement(boolean allowNullElement)
Sets whether undefined list elements are valid.- Parameters:
allowNullElement- whether undefined elements are valid- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowDuplicates
public BUILDER setAllowDuplicates(boolean allowDuplicates)
toggles default validator strategy to allow / not allow duplicate elements in list- Parameters:
allowDuplicates- false if duplicates are not allowed- Returns:
- builder
-
getValidator
public ParameterValidator getValidator()
- Overrides:
getValidatorin classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>,ATTRIBUTE extends ListAttributeDefinition>
-
-