org.elkoserver.server.context.mods
Class Image
java.lang.Object
org.elkoserver.server.context.Mod
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.
| Methods inherited from class org.elkoserver.server.context.Mod |
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object |
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.
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.