Interface NiceModelReceiver


public interface NiceModelReceiver
  • Method Details

    • addEntity

      void addEntity(EntityModel model) throws ModelBuildException
      Callback for the XML reader.

      WARNING: most properties are not set at this time! Only name and disabled are there, rest comes later. Check the implementation.

      Parameters:
      model - The entity model to add.
      Throws:
      ModelBuildException - .
    • getEntity

      @Nullable @Nullable EntityModel getEntity(String name)
    • getEntities

      Iterable<EntityModel> getEntities()
    • removeEntity

      void removeEntity(EntityModel toRemove)
    • getConceptionValidator

      NiceModelValidator getConceptionValidator()
      Get the validator for the model.

      ATTENTION: This validator has to be able to handle a model in a conceptional-state. Maybe some stuff gets changed, removed etc later. Also not all models have been read yet! For example the relations of an entity are not there when the entity model is validated!

      Returns:
      the validator, non-null
    • getType

      @Nullable @Nullable Type<?> getType(String name)
      Get the type.
      Parameters:
      name - the name of the type.
      Returns:
      the type.
    • requireType

      Type<?> requireType(String name) throws NoSuchTypeException
      Throws:
      NoSuchTypeException
    • withEntityModel

      void withEntityModel(String name, Function<EntityModel,Void> function)
      Execute a function with an entity model as argument once the required entity model exists. This method is generally preferred over getEntity(java.lang.String) followed by a null-check to make sure the required entity model exists already.
      Note that the function is only executed if the required model will be created at all!
      Parameters:
      name - the name of an entity model to be passed as argument into the provided function
      function - a function to be executed with the requested entity model
    • onDoneReceiving

      void onDoneReceiving()
      Method called when the receiver is done, can be used to clean up the receiver.