.. java:import:: org.motechproject.mds.domain ClassData .. java:import:: org.motechproject.mds.domain Entity .. java:import:: org.osgi.framework Bundle EntityBuilder ============= .. java:package:: org.motechproject.mds.builder :noindex: .. java:type:: public interface EntityBuilder An entity builder is responsible for building the entity class from an Entity schema. Methods ------- build ^^^^^ .. java:method:: ClassData build(Entity entity) :outertype: EntityBuilder Builds a class definition for a given entity. The class is not registered with any classloader. :param entity: the entity schema :return: bytes of the newly constructed class buildDDE ^^^^^^^^ .. java:method:: ClassData buildDDE(Entity entity, Bundle bundle) :outertype: EntityBuilder Builds Developer Defined Entity. The main difference between regular build method and this one, is that this method fetches the class definition from the given bundle, and injects members to the constructed class from there, if possible, rather than building everything from scratch. :param entity: the entity schema :param bundle: the bundle to fetch class definition from :return: bytes of the constructed class buildHistory ^^^^^^^^^^^^ .. java:method:: ClassData buildHistory(Entity entity) :outertype: EntityBuilder Builds History class definition for the given entity. The history class definition contains the same members as the entity class, plus some fields history-exclusive, like schema version. :param entity: the entity schema :return: bytes of the constructed class buildTrash ^^^^^^^^^^ .. java:method:: ClassData buildTrash(Entity entity) :outertype: EntityBuilder Builds Trash class definition for the given entity. The trash class definition contains the same members as the entity class, plus some fields trash-exclusive. :param entity: the entity schema :return: bytes of the constructed class prepareHistoryClass ^^^^^^^^^^^^^^^^^^^ .. java:method:: void prepareHistoryClass(Entity entity) :outertype: EntityBuilder Builds empty history class definition for the given entity and adds it to the class pool. :param entity: the entity schema prepareTrashClass ^^^^^^^^^^^^^^^^^ .. java:method:: void prepareTrashClass(Entity entity) :outertype: EntityBuilder Builds empty trash class definition for the given entity and adds it to the class pool. :param entity: the entity schema