T
- the RestBasicEntity
subclasspublic abstract class AbstractEntitySerializer<T extends AbstractKEntity> extends com.google.gson.TypeAdapter<T> implements JsonConstants
Modifier and Type | Field and Description |
---|---|
protected static Type |
BOOLEAN_MAP_TYPE |
protected static Type |
STRING_MAP_TYPE |
BASE_URI, CHILDREN, DATA_PATH, DDL_ATTRIBUTE, DEFAULT_VALUE, DESCRIPTION, HAS_CHILDREN, HREF, ID, KENGINE_PREFIX, KTYPE, LIMIT, LINKS, NULL, PARENT, PREFIX_PATTERN, PREFIX_SEPARATOR, PROPERTIES, REL, REPEATABLE, REQUIRED, SELF, TYPE, VALUES
AMPERSAND, AT, BR, CLASS, CLOSE_ANGLE_BRACKET, CLOSE_BRACE, CLOSE_BRACKET, CLOSE_PRE_CMT, CLOSE_PRE_TAG, CLOSE_SQUARE_BRACKET, COLON, COMMA, CONNECTION_SUFFIX, CURRENT_FOLDER_SYMBOL, DDL, DEFAULT_LOCAL_WORKSPACE_NAME, DIVIDE, DOLLAR_SIGN, DOT, DOT_CHAR, DOT_DOT, DOT_KOMODO, DOUBLE_BACK_SLASH, DRIVE_SEPARATOR, EMPTY_ARRAY, EMPTY_STRING, ENUM, EQUALS, FILE_EXTENSION_SEPARATOR, FILE_NAME_WILDCARD, FINAL, FORWARD_SLASH, HASH, HYPHEN, INTERFACE, JAR, JAVA, JAVA_IO_TMPDIR, JBOSS_SERVER_TMP_DIR, KOMODO, LINE_SEPARATOR, LINE_SEPARATOR_PROPERTY_NAME, LOG, MINUS, MULTIPLY, NBSP, NEW_LINE, OPEN_ANGLE_BRACKET, OPEN_BRACE, OPEN_BRACKET, OPEN_PRE_CMT, OPEN_PRE_TAG, OPEN_SQUARE_BRACKET, PARENT_FOLDER_SYMBOL, PERCENT, PIPE, PLUS, PRIVATE, PUBLIC, QUESTION_MARK, QUOTE_MARK, SEMI_COLON, SERVICE_VDB_SUFFIX, SERVICE_VDB_VIEW_MODEL, SERVICE_VDB_VIEW_SUFFIX, SOURCES, SPACE, SPEECH_MARK, SRC, STAR, STATIC, TAB, TARGET, UNDERSCORE, UNDERSCORE_CHAR, VDB_DEPLOYMENT_SUFFIX, VDB_PREFIX, XML, XML_SUFFIX, ZIP, ZIP_SUFFIX
Constructor and Description |
---|
AbstractEntitySerializer() |
Modifier and Type | Method and Description |
---|---|
protected void |
beginRead(com.google.gson.stream.JsonReader in) |
protected void |
beginWrite(com.google.gson.stream.JsonWriter out) |
protected abstract T |
createEntity() |
protected void |
endRead(com.google.gson.stream.JsonReader in) |
protected void |
endWrite(com.google.gson.stream.JsonWriter out) |
protected abstract boolean |
isComplete(T entity) |
T |
read(com.google.gson.stream.JsonReader in) |
protected abstract String |
readExtension(String name,
T entity,
com.google.gson.stream.JsonReader in)
Sub-classes should implement this to write further data to the json
|
protected void |
readLinks(com.google.gson.stream.JsonReader in,
T value) |
protected void |
readProperties(com.google.gson.stream.JsonReader in,
T value) |
void |
write(com.google.gson.stream.JsonWriter out,
T entity) |
protected abstract void |
writeExtensions(com.google.gson.stream.JsonWriter out,
T entity)
Sub-classes should implement this to write further data to the json
|
protected void |
writeLinks(com.google.gson.stream.JsonWriter out,
T value) |
protected void |
writeProperties(com.google.gson.stream.JsonWriter out,
T value) |
protected void |
writeTuples(com.google.gson.stream.JsonWriter out,
T entity) |
protected void |
writeValue(com.google.gson.stream.JsonWriter out,
Object value) |
protected static final Type BOOLEAN_MAP_TYPE
protected static final Type STRING_MAP_TYPE
protected void beginRead(com.google.gson.stream.JsonReader in) throws IOException
IOException
protected void beginWrite(com.google.gson.stream.JsonWriter out) throws IOException
IOException
protected void endRead(com.google.gson.stream.JsonReader in) throws IOException
IOException
protected void endWrite(com.google.gson.stream.JsonWriter out) throws IOException
IOException
protected abstract T createEntity()
protected abstract String readExtension(String name, T entity, com.google.gson.stream.JsonReader in)
name
- entity
- in
- IOException
public T read(com.google.gson.stream.JsonReader in) throws IOException
read
in class com.google.gson.TypeAdapter<T extends AbstractKEntity>
IOException
TypeAdapter.read(com.google.gson.stream.JsonReader)
protected void readProperties(com.google.gson.stream.JsonReader in, T value)
protected void readLinks(com.google.gson.stream.JsonReader in, T value)
protected abstract void writeExtensions(com.google.gson.stream.JsonWriter out, T entity) throws IOException
out
- entity
- IOException
public void write(com.google.gson.stream.JsonWriter out, T entity) throws IOException
write
in class com.google.gson.TypeAdapter<T extends AbstractKEntity>
IOException
TypeAdapter.write(com.google.gson.stream.JsonWriter, java.lang.Object)
protected void writeProperties(com.google.gson.stream.JsonWriter out, T value) throws IOException
IOException
protected void writeLinks(com.google.gson.stream.JsonWriter out, T value) throws IOException
IOException
protected void writeValue(com.google.gson.stream.JsonWriter out, Object value) throws IOException
IOException
protected void writeTuples(com.google.gson.stream.JsonWriter out, T entity) throws IOException
IOException
protected abstract boolean isComplete(T entity)
entity
- the entityCopyright © 2013–2019. All rights reserved.