Skip to content

Commit

Permalink
Fix javadoc for release....
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Morel committed Oct 23, 2016
1 parent 54081bb commit 4ba7f99
Show file tree
Hide file tree
Showing 208 changed files with 2,877 additions and 200 deletions.
7 changes: 7 additions & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import com.github.nmorel.gwtjackson.client.ser.map.key.KeySerializer;

/**
* <p>Abstract AbstractConfiguration class.</p>
*
* @author Nicolas Morel
* @version $Id: $
*/
public abstract class AbstractConfiguration {

Expand Down Expand Up @@ -111,12 +114,18 @@ public KeyTypeConfiguration<T> deserializer( Class<? extends KeyDeserializer> de

private JsonAutoDetect.Visibility creatorVisibility = JsonAutoDetect.Visibility.DEFAULT;

/**
* <p>Constructor for AbstractConfiguration.</p>
*/
protected AbstractConfiguration() {
configure();
}

/**
* Return a {@link PrimitiveTypeConfiguration} to configure serializer and/or deserializer for the given primitive type.
* <p>primitiveType</p>
*
* @param type Type
* @return a {@link PrimitiveTypeConfiguration} to configure serializer and/or deserializer for the given primitive type.
*/
protected PrimitiveTypeConfiguration primitiveType( Class type ) {
if ( !type.isPrimitive() ) {
Expand All @@ -126,7 +135,11 @@ protected PrimitiveTypeConfiguration primitiveType( Class type ) {
}

/**
* Return a {@link TypeConfiguration} to configure serializer and/or deserializer for the given type.
* <p>type</p>
*
* @param type Type
* @return a {@link TypeConfiguration} to configure serializer and/or deserializer for the given type.
* @param <T> a T object.
*/
protected <T> TypeConfiguration<T> type( Class<T> type ) {
if ( type.isPrimitive() ) {
Expand All @@ -137,6 +150,10 @@ protected <T> TypeConfiguration<T> type( Class<T> type ) {

/**
* Return a {@link KeyTypeConfiguration} to configure key serializer and/or deserializer for the given type.
*
* @param type a {@link java.lang.Class} object.
* @param <T> Type
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration.KeyTypeConfiguration} object.
*/
protected <T> KeyTypeConfiguration<T> key( Class<T> type ) {
if ( type.isPrimitive() ) {
Expand All @@ -154,6 +171,7 @@ protected <T> KeyTypeConfiguration<T> key( Class<T> type ) {
* @param target Class (or interface) whose annotations to effectively override
* @param mixinSource Class (or interface) whose annotations are to
* be "added" to target's annotations, overriding as necessary
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration addMixInAnnotations( Class<?> target, Class<?> mixinSource ) {
mapMixInAnnotations.put( target, mixinSource );
Expand All @@ -168,6 +186,7 @@ protected AbstractConfiguration addMixInAnnotations( Class<?> target, Class<?> m
* </p>
*
* @param regex the regex to add
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration whitelist( String regex ) {
whitelist.add( regex );
Expand All @@ -178,6 +197,7 @@ protected AbstractConfiguration whitelist( String regex ) {
* Override the default behaviour of {@link JsonAutoDetect.Visibility#DEFAULT} for fields.
*
* @param visibility the new default behaviour
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration fieldVisibility( JsonAutoDetect.Visibility visibility ) {
this.fieldVisibility = visibility;
Expand All @@ -188,6 +208,7 @@ protected AbstractConfiguration fieldVisibility( JsonAutoDetect.Visibility visib
* Override the default behaviour of {@link JsonAutoDetect.Visibility#DEFAULT} for getters.
*
* @param visibility the new default behaviour
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration getterVisibility( JsonAutoDetect.Visibility visibility ) {
this.getterVisibility = visibility;
Expand All @@ -198,6 +219,7 @@ protected AbstractConfiguration getterVisibility( JsonAutoDetect.Visibility visi
* Override the default behaviour of {@link JsonAutoDetect.Visibility#DEFAULT} for boolean getters.
*
* @param visibility the new default behaviour
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration isGetterVisibility( JsonAutoDetect.Visibility visibility ) {
this.isGetterVisibility = visibility;
Expand All @@ -208,6 +230,7 @@ protected AbstractConfiguration isGetterVisibility( JsonAutoDetect.Visibility vi
* Override the default behaviour of {@link JsonAutoDetect.Visibility#DEFAULT} for setters.
*
* @param visibility the new default behaviour
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration setterVisibility( JsonAutoDetect.Visibility visibility ) {
this.setterVisibility = visibility;
Expand All @@ -218,54 +241,113 @@ protected AbstractConfiguration setterVisibility( JsonAutoDetect.Visibility visi
* Override the default behaviour of {@link JsonAutoDetect.Visibility#DEFAULT} for creators.
*
* @param visibility the new default behaviour
* @return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration} object.
*/
protected AbstractConfiguration creatorVisibility( JsonAutoDetect.Visibility visibility ) {
this.creatorVisibility = visibility;
return this;
}

/**
* <p>configure</p>
*/
protected abstract void configure();

/**
* <p>Getter for the field <code>mapTypeToSerializer</code>.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<Class, Class> getMapTypeToSerializer() {
return mapTypeToSerializer;
}

/**
* <p>Getter for the field <code>mapTypeToDeserializer</code>.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<Class, Class> getMapTypeToDeserializer() {
return mapTypeToDeserializer;
}

/**
* <p>Getter for the field <code>mapTypeToKeySerializer</code>.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<Class, Class> getMapTypeToKeySerializer() {
return mapTypeToKeySerializer;
}

/**
* <p>Getter for the field <code>mapTypeToKeyDeserializer</code>.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<Class, Class> getMapTypeToKeyDeserializer() {
return mapTypeToKeyDeserializer;
}

/**
* <p>Getter for the field <code>mapMixInAnnotations</code>.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<Class, Class> getMapMixInAnnotations() {
return mapMixInAnnotations;
}

/**
* <p>Getter for the field <code>whitelist</code>.</p>
*
* @return a {@link java.util.List} object.
*/
public List<String> getWhitelist() {
return whitelist;
}

/**
* <p>Getter for the field <code>fieldVisibility</code>.</p>
*
* @return a {@link com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility} object.
*/
public Visibility getFieldVisibility() {
return fieldVisibility;
}

/**
* <p>Getter for the field <code>getterVisibility</code>.</p>
*
* @return a {@link com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility} object.
*/
public Visibility getGetterVisibility() {
return getterVisibility;
}

/**
* <p>Getter for the field <code>isGetterVisibility</code>.</p>
*
* @return a {@link com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility} object.
*/
public Visibility getIsGetterVisibility() {
return isGetterVisibility;
}

/**
* <p>Getter for the field <code>setterVisibility</code>.</p>
*
* @return a {@link com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility} object.
*/
public Visibility getSetterVisibility() {
return setterVisibility;
}

/**
* <p>Getter for the field <code>creatorVisibility</code>.</p>
*
* @return a {@link com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility} object.
*/
public Visibility getCreatorVisibility() {
return creatorVisibility;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Base implementation of {@link ObjectMapper}. It delegates the serialization/deserialization to a serializer/deserializer.
*
* @author Nicolas Morel
* @version $Id: $
*/
public abstract class AbstractObjectMapper<T> implements ObjectMapper<T> {

Expand All @@ -35,15 +36,22 @@ public abstract class AbstractObjectMapper<T> implements ObjectMapper<T> {

private JsonSerializer<T> serializer;

/**
* <p>Constructor for AbstractObjectMapper.</p>
*
* @param rootName a {@link java.lang.String} object.
*/
protected AbstractObjectMapper( String rootName ) {
this.rootName = rootName;
}

/** {@inheritDoc} */
@Override
public T read( String in ) throws JsonDeserializationException {
return read( in, JsonDeserializationContext.builder().build() );
}

/** {@inheritDoc} */
@Override
public T read( String in, JsonDeserializationContext ctx ) throws JsonDeserializationException {
JsonReader reader = ctx.newJsonReader( in );
Expand Down Expand Up @@ -83,6 +91,8 @@ public T read( String in, JsonDeserializationContext ctx ) throws JsonDeserializ
}

/**
* <p>Getter for the field <code>deserializer</code>.</p>
*
* @return the {@link JsonDeserializer} used by this mapper
*/
public JsonDeserializer<T> getDeserializer() {
Expand All @@ -99,11 +109,13 @@ public JsonDeserializer<T> getDeserializer() {
*/
protected abstract JsonDeserializer<T> newDeserializer();

/** {@inheritDoc} */
@Override
public String write( T value ) throws JsonSerializationException {
return write( value, JsonSerializationContext.builder().build() );
}

/** {@inheritDoc} */
@Override
public String write( T value, JsonSerializationContext ctx ) throws JsonSerializationException {
JsonWriter writer = ctx.newJsonWriter();
Expand All @@ -126,6 +138,8 @@ public String write( T value, JsonSerializationContext ctx ) throws JsonSerializ
}

/**
* <p>Getter for the field <code>serializer</code>.</p>
*
* @return the {@link JsonSerializer} used by this mapper
*/
public JsonSerializer<T> getSerializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@
* reader will result in an {@link UnsupportedOperationException}.
*
* @author Nicolas Morel
* @version $Id: $
*/
public abstract class AbstractObjectReader<T> extends AbstractObjectMapper<T> implements ObjectReader<T> {

/**
* <p>Constructor for AbstractObjectReader.</p>
*
* @param rootName a {@link java.lang.String} object.
*/
public AbstractObjectReader( String rootName ) {
super( rootName );
}

/** {@inheritDoc} */
@Override
protected final JsonSerializer<?> newSerializer() {
throw new UnsupportedOperationException( "ObjectReader doesn't support serialization" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@
* writer will result in an {@link UnsupportedOperationException}.
*
* @author Nicolas Morel
* @version $Id: $
*/
public abstract class AbstractObjectWriter<T> extends AbstractObjectMapper<T> implements ObjectWriter<T> {

/**
* <p>Constructor for AbstractObjectWriter.</p>
*
* @param rootName a {@link java.lang.String} object.
*/
public AbstractObjectWriter( String rootName ) {
super( rootName );
}

/** {@inheritDoc} */
@Override
protected final JsonDeserializer<T> newDeserializer() {
throw new UnsupportedOperationException( "ObjectWriter doesn't support deserialization" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,52 @@

/**
* Wrapper to access both key and json deserializer for a type.
*
* @author nicolasmorel
* @version $Id: $
*/
public abstract class Deserializer<T> {

private KeyDeserializer<T> key;

private JsonDeserializer<T> json;

/**
* <p>key</p>
*
* @return a {@link com.github.nmorel.gwtjackson.client.deser.map.key.KeyDeserializer} object.
*/
public KeyDeserializer<T> key() {
if ( null == key ) {
key = createKeyDeserializer();
}
return key;
}

/**
* <p>createKeyDeserializer</p>
*
* @return a {@link com.github.nmorel.gwtjackson.client.deser.map.key.KeyDeserializer} object.
*/
protected abstract KeyDeserializer<T> createKeyDeserializer();

/**
* <p>json</p>
*
* @return a {@link com.github.nmorel.gwtjackson.client.JsonDeserializer} object.
*/
public JsonDeserializer<T> json() {
if ( null == json ) {
json = createJsonDeserializer();
}
return json;
}

/**
* <p>createJsonDeserializer</p>
*
* @return a {@link com.github.nmorel.gwtjackson.client.JsonDeserializer} object.
*/
protected abstract JsonDeserializer<T> createJsonDeserializer();

}
Loading

0 comments on commit 4ba7f99

Please sign in to comment.