us.asciiroth.client.core
Class TypeOnlySerializer<T extends Piece>

java.lang.Object
  extended by us.asciiroth.client.core.TypeOnlySerializer<T>
Type Parameters:
T -
All Implemented Interfaces:
Serializer<T>

public abstract class TypeOnlySerializer<T extends Piece>
extends java.lang.Object
implements Serializer<T>

A serializer base that will work for any piece that is defined only by its type. Subclasses need only implement the create method and return a new instance of the type.


Constructor Summary
TypeOnlySerializer()
           
 
Method Summary
 T example()
          Provide an example of this piece for display in the editor.
 java.lang.String store(T piece)
          Create a string representation of this piece, referred to in the code as a "key".
 java.lang.String template(java.lang.String key)
          Provide a template string that can be used by the editor to guide the creation of a valid instance of this type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface us.asciiroth.client.core.Serializer
create, getTag
 

Constructor Detail

TypeOnlySerializer

public TypeOnlySerializer()
Method Detail

example

public T example()
Description copied from interface: Serializer
Provide an example of this piece for display in the editor.

Specified by:
example in interface Serializer<T extends Piece>
Returns:
an example piece to demonstrate the type in the map editor

store

public java.lang.String store(T piece)
Description copied from interface: Serializer
Create a string representation of this piece, referred to in the code as a "key".

Specified by:
store in interface Serializer<T extends Piece>
Returns:
a string key for the supplied piece

template

public java.lang.String template(java.lang.String key)
Description copied from interface: Serializer
Provide a template string that can be used by the editor to guide the creation of a valid instance of this type.

Specified by:
template in interface Serializer<T extends Piece>
Returns:
a key-like template that can be used in the editor

0.7

2009 Alx Dark