org.elkoserver.server.context.mods
Class Image

java.lang.Object
  extended by org.elkoserver.server.context.Mod
      extended by org.elkoserver.server.context.mods.Image
All Implemented Interfaces:
Cloneable, DispatchTarget, Encodable, ContextMod, GeneralMod, ItemMod, UserMod

public class Image
extends Mod
implements GeneralMod

Mod to associate an image with an object. This mod may be attached to a context or a user or an item. This mod has no behavioral repertoire of its own, but simply holds onto descriptive information for the benefit of the client.


Constructor Summary
Image(OptInteger width, OptInteger height, String img)
          JSON-driven constructor.
 
Method Summary
 JSONLiteral encode(EncodeControl control)
          Encode this mod for transmission or persistence.
 
Methods inherited from class org.elkoserver.server.context.Mod
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

@JSONMethod(value={"width","height","img"})
public Image(OptInteger width,
                             OptInteger height,
                             String img)
JSON-driven constructor.

Parameters:
width - Horizontal extent of the image (optional).
height - Vertical extent of the image (optional).
img - URL of the image itself.
Method Detail

encode

public JSONLiteral encode(EncodeControl control)
Encode this mod for transmission or persistence.

Specified by:
encode in interface Encodable
Parameters:
control - Encode control determining what flavor of encoding should be done.
Returns:
a JSON literal representing this mod.