Class AbstractRelationModelHandler
java.lang.Object
ch.tocco.nice2.model.entity.impl.reading.relation.AbstractRelationModelHandler
- All Implemented Interfaces:
ValidatorReceivable
- Direct Known Subclasses:
RelationModelHandler
,RelationOverrideModelHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected ch.tocco.nice2.model.entity.impl.reading.relation.CardinalityParser
protected DefaultValueReceiverImpl
protected final DisplayValueFactory
protected final NiceModelReceiver
protected final DefaultValueResolver
protected final SelectorFactoryManager
protected RelationPathHandler
protected RelationPathHandler
protected @Nullable AndGroupValidator
This is where I keep it until my finish() is called.protected ValidatorReceiver
The ValidatorReceiver will call my addValidator() method (since I'm a ValidatorReceivable) to inject a GroupValidator into me, which I will pass on to my field in finish() → assignValidatorToField(). -
Constructor Summary
ConstructorDescriptionAbstractRelationModelHandler
(NiceModelReceiver receiver, DisplayValueFactory displays, SelectorFactoryManager selectors, ValidatorHandlerContextFactory validatorHandlerContextFactory, DefaultValueResolver resolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNameAndDefaultLabels
(RelationModel sourceRelModel, RelationModel targetRelModel) void
addValidator
(Validator validator) This case only allows an AndGroupValidatorImpl, not just any validator!void
parseCardinality
(String cardinality) protected void
setDefaultValueToRelation
(RelationModel relation) void
void
startElement
(String elementName, URI resourceName)
-
Field Details
-
receiver
-
displays
-
selectors
-
resolver
-
cardinality
protected ch.tocco.nice2.model.entity.impl.reading.relation.CardinalityParser cardinality -
sourceHndlr
-
targetHndlr
-
validatorReceiver
The ValidatorReceiver will call my addValidator() method (since I'm a ValidatorReceivable) to inject a GroupValidator into me, which I will pass on to my field in finish() → assignValidatorToField(). -
validator
This is where I keep it until my finish() is called. -
defaultValueReceiver
-
-
Constructor Details
-
AbstractRelationModelHandler
public AbstractRelationModelHandler(NiceModelReceiver receiver, DisplayValueFactory displays, SelectorFactoryManager selectors, ValidatorHandlerContextFactory validatorHandlerContextFactory, DefaultValueResolver resolver)
-
-
Method Details
-
startElement
@StartElement public void startElement(@ElementName String elementName, @ResourceName URI resourceName) -
setSchema
-
parseCardinality
@Element("cardinality") @Required public void parseCardinality(@Content String cardinality) throws InvalidValueException - Throws:
InvalidValueException
-
addDefaultValues
@Element("default") @Cardinality(min=0, max=1) public DefaultValueHandler addDefaultValues() throws ModelBuildException- Throws:
ModelBuildException
-
addValidations
@Element("validations") @Cardinality(min=0, max=1) public AndGroupValidatorModelHandler addValidations() throws ModelBuildException- Throws:
ModelBuildException
-
addValidator
This case only allows an AndGroupValidatorImpl, not just any validator!- Specified by:
addValidator
in interfaceValidatorReceivable
- Parameters:
validator
- The main group.- Throws:
IllegalArgumentException
- if a later validator uses a stronger error level than a previous one in the same group.
-
addNameAndDefaultLabels
protected void addNameAndDefaultLabels(RelationModel sourceRelModel, RelationModel targetRelModel) throws InvalidValueException - Throws:
InvalidValueException
-
setDefaultValueToRelation
- Throws:
InvalidValueException
-