Class AbstractXMLUnmarshallerModelBuilder

java.lang.Object
ch.tocco.nice2.model.base.spi.base.AbstractXMLUnmarshallerModelBuilder
All Implemented Interfaces:
NiceModelBuilder
Direct Known Subclasses:
AbstractXmlMenuBuilder, FormBuilder, RemoveFormBuilder, XMLFormBuilder, XMLFormRemove, XMLNiceEntityBuilder, XMLRelationBuilder, XMLRelationOverrideBuilder, XMLRemove, XMLTemplateBuilder

public abstract class AbstractXMLUnmarshallerModelBuilder extends Object implements NiceModelBuilder
An abstract model builder, which already sets up the history-writer, log etc.

Usage:

  • Field Details

  • Constructor Details

    • AbstractXMLUnmarshallerModelBuilder

      protected AbstractXMLUnmarshallerModelBuilder(org.slf4j.Logger log, DisplayValueFactory displayValueFactory)
  • Method Details

    • buildHandlerInstance

      protected abstract Object buildHandlerInstance(Object receiver)
      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

      Parameters:
      receiver - the receiver.
      Returns:
      the instance, non-null.
    • getFirstTag

      protected abstract String getFirstTag()
      Return the name of the first xml-tag
      Returns:
      non-null
    • buildModel

      public final void buildModel(InputStream source, URI location, Object receiver) throws ModelBuildException
      Specified by:
      buildModel in interface NiceModelBuilder
      Parameters:
      source - the source-stream. The stream gets closed by the caller.
      location - the location as URI
      receiver - the receiver
      Throws:
      ModelBuildException - if something went wrong
    • beforeParse

      protected boolean beforeParse(URI location)
      Will be called before the parsing begins.
      Parameters:
      location - the current location or null
      Returns:
      veto. if true the current location will not be parsed
    • afterParse

      protected void afterParse(URI location)
      Will be called after the parsing ended
      Parameters:
      location - the current location or null
    • shouldIgnoreUnhandledAttributes

      protected boolean shouldIgnoreUnhandledAttributes()