Class FormBuilder
java.lang.Object
ch.tocco.nice2.model.base.spi.base.AbstractXMLUnmarshallerModelBuilder
ch.tocco.nice2.model.form.impl.form2.reader.FormBuilder
- All Implemented Interfaces:
NiceModelBuilder
Parses existing xml forms into the new structure which will be used by the REST api in the future.
Only supports a subset of the form xml, as some elements and attributes are no longer used
by the new client.
-
Field Summary
Fields inherited from class ch.tocco.nice2.model.base.spi.base.AbstractXMLUnmarshallerModelBuilder
displayValueFactory, factory, log
-
Constructor Summary
ConstructorDescriptionFormBuilder
(org.slf4j.Logger log, DisplayValueFactory displayValueFactory, NiceDataModel dataModel, DefaultValueResolver defaultValueResolver, ValidatorHandlerContextFactory validatorHandlerContextFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeParse
(URI location) Will be called before the parsing begins.protected Object
buildHandlerInstance
(Object receiver) Return a new instance of a class, which can handle the event of the xml-unmarshallerprotected String
Return the name of the first xml-taggetType()
Return the type of Tvoid
setExcludePatterns
(List<String> excludePatterns) protected boolean
Methods inherited from class ch.tocco.nice2.model.base.spi.base.AbstractXMLUnmarshallerModelBuilder
afterParse, buildModel
-
Constructor Details
-
FormBuilder
public FormBuilder(org.slf4j.Logger log, DisplayValueFactory displayValueFactory, @Lazy NiceDataModel dataModel, @Lazy DefaultValueResolver defaultValueResolver, ValidatorHandlerContextFactory validatorHandlerContextFactory)
-
-
Method Details
-
setExcludePatterns
-
buildHandlerInstance
Description copied from class:AbstractXMLUnmarshallerModelBuilder
Return a new instance of a class, which can handle the event of the xml-unmarshaller State: It's guaranteed that all protected methods are set and valid- Specified by:
buildHandlerInstance
in classAbstractXMLUnmarshallerModelBuilder
- Parameters:
receiver
- the receiver.- Returns:
- the instance, non-null.
-
getFirstTag
Description copied from class:AbstractXMLUnmarshallerModelBuilder
Return the name of the first xml-tag- Specified by:
getFirstTag
in classAbstractXMLUnmarshallerModelBuilder
- Returns:
- non-null
-
shouldIgnoreUnhandledAttributes
protected boolean shouldIgnoreUnhandledAttributes()- Overrides:
shouldIgnoreUnhandledAttributes
in classAbstractXMLUnmarshallerModelBuilder
-
getType
Description copied from interface:NiceModelBuilder
Return the type of T -
beforeParse
Description copied from class:AbstractXMLUnmarshallerModelBuilder
Will be called before the parsing begins.- Overrides:
beforeParse
in classAbstractXMLUnmarshallerModelBuilder
- Parameters:
location
- the current location or null- Returns:
- veto. if true the current location will not be parsed
-