Class RegionExportJson

java.lang.Object
fr.ifremer.isisfish.entities.RegionExportJson
All Implemented Interfaces:
org.nuiton.topia.persistence.EntityVisitor

public class RegionExportJson extends Object implements org.nuiton.topia.persistence.EntityVisitor
Classe permettant d'exporter en Json une region Format du JSON: { "#info": { "formatVersion": int "isisVersion": String "region": boolean if true contains one region, if false contains one Entity "root": toString representation of root entity "rootId": id of root entity }, "#entities": { " <id>": {<entity field>}, ... }, "FisheryRegion" : [<id>], "Cell": [<id>, ...], "Zone": [<id>, ...], ... }
Version:
$Revision$ Last update: $Date$ by : $Author$
Author:
poussin
  • Field Details

  • Constructor Details

    • RegionExportJson

      public RegionExportJson(Writer w)
  • Method Details

    • export

      public void export(FisheryRegion fisheryRegion)
      Export la region et tous les elements de la region.
      Parameters:
      fisheryRegion -
    • export

      public void export(org.nuiton.topia.persistence.TopiaEntity entity)
      Export seulement l'entity et ses dépendances.
      Parameters:
      entity -
    • export

      protected void export(org.nuiton.topia.persistence.TopiaEntity entity, boolean isRegion)
    • writeValue

      protected void writeValue(Class<?> type, Object value)
    • start

      public void start()
    • end

      public void end()
    • start

      public void start(org.nuiton.topia.persistence.TopiaEntity entity)
      Start the visit of the given entity.
      Specified by:
      start in interface org.nuiton.topia.persistence.EntityVisitor
      Parameters:
      entity - the visited entity
    • end

      public void end(org.nuiton.topia.persistence.TopiaEntity entity)
      Ends the visit of the given entity.
      Specified by:
      end in interface org.nuiton.topia.persistence.EntityVisitor
      Parameters:
      entity - the visited entity
    • visit

      public void visit(org.nuiton.topia.persistence.TopiaEntity entity, String propertyName, Class<?> type, Object value)
      Visit a none indexed property for the given entity. The property visited is defined by the other parameters.
      Specified by:
      visit in interface org.nuiton.topia.persistence.EntityVisitor
      Parameters:
      entity - the visited entity
      propertyName - the name of the visited property
      type - the type of the visited property
      value - the value of the visited property
    • visit

      public void visit(org.nuiton.topia.persistence.TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value)
      Visit a collection property for the given entity. The property visited is defined by the other parameters.
      Specified by:
      visit in interface org.nuiton.topia.persistence.EntityVisitor
      Parameters:
      entity - the visited entity
      propertyName - the name of the visited property
      collectionType - the type of the visited collection
      type - the type of the visited property
      value - the value of the visited property
    • visit

      public void visit(org.nuiton.topia.persistence.TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value)
      Visit a indexed value from a collection property for the given entity. The property visited is defined by the other parameters.
      Specified by:
      visit in interface org.nuiton.topia.persistence.EntityVisitor
      Parameters:
      entity - the visited entity
      propertyName - the name of the visited property
      collectionType - the type of the container of the visited property
      type - the type of the visited property
      index - the index of the visited property in his container
      value - the value of the visited property
    • clear

      public void clear()
      Reset all states of the visitor. If you use internal states inside the visitor, this method should clean all of them. This method should be invoked after usage of the visitor.
      Specified by:
      clear in interface org.nuiton.topia.persistence.EntityVisitor