Package fr.ifremer.isisfish.entities
Class RegionExportJson
java.lang.Object
fr.ifremer.isisfish.entities.RegionExportJson
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprotected EntitySemanticsDecoratorprotected booleanstatic final Stringstatic final intprotected com.fasterxml.jackson.core.JsonGeneratorprotected LinkedHashMap<String,List<String>> protected MatrixCSVHelperprotected LinkedList<org.nuiton.topia.persistence.TopiaEntity> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset all states of the visitor.voidend()voidend(org.nuiton.topia.persistence.TopiaEntity entity) Ends the visit of the given entity.voidexport(FisheryRegion fisheryRegion) Export la region et tous les elements de la region.voidexport(org.nuiton.topia.persistence.TopiaEntity entity) Export seulement l'entity et ses dépendances.protected voidexport(org.nuiton.topia.persistence.TopiaEntity entity, boolean isRegion) voidstart()voidstart(org.nuiton.topia.persistence.TopiaEntity entity) Start the visit of the given entity.voidvisit(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.voidvisit(org.nuiton.topia.persistence.TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value) Visit a collection property for the given entity.voidvisit(org.nuiton.topia.persistence.TopiaEntity entity, String propertyName, Class<?> type, Object value) Visit a none indexed property for the given entity.protected voidwriteValue(Class<?> type, Object value)
-
Field Details
-
FORMAT_VERSION
public static final int FORMAT_VERSION- See Also:
-
FORMAT_EXTENSION
- See Also:
-
toVisit
-
visited
-
isisEntities
-
doVisit
protected boolean doVisit -
matrixCSVHelper
-
decorator
-
g
protected com.fasterxml.jackson.core.JsonGenerator g
-
-
Constructor Details
-
RegionExportJson
-
-
Method Details
-
export
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
-
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:
startin interfaceorg.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:
endin interfaceorg.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:
visitin interfaceorg.nuiton.topia.persistence.EntityVisitor- Parameters:
entity- the visited entitypropertyName- the name of the visited propertytype- the type of the visited propertyvalue- 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:
visitin interfaceorg.nuiton.topia.persistence.EntityVisitor- Parameters:
entity- the visited entitypropertyName- the name of the visited propertycollectionType- the type of the visited collectiontype- the type of the visited propertyvalue- 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:
visitin interfaceorg.nuiton.topia.persistence.EntityVisitor- Parameters:
entity- the visited entitypropertyName- the name of the visited propertycollectionType- the type of the container of the visited propertytype- the type of the visited propertyindex- the index of the visited property in his containervalue- 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:
clearin interfaceorg.nuiton.topia.persistence.EntityVisitor
-