ubiware.util.saplbuilder
Class Literal

java.lang.Object
  extended by ubiware.util.saplbuilder.Literal
All Implemented Interfaces:
Object, Subject

public class Literal
extends java.lang.Object
implements Subject, Object

Representation of a literal.

Since:
17 Aug 2010
Author:
Michael Cochez for Ubiware project

Constructor Summary
Literal(boolean value)
           
Literal(java.util.Date date)
          Constructs a literal from a date.
Literal(java.lang.String value)
          Constructs a literal from the given string representation.
 
Method Summary
 void generateSapl(java.lang.StringBuilder builder)
          Generates the s-apl representation of the literal.
 java.lang.String toString()
          Returns the literal value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(java.lang.String value)
Constructs a literal from the given string representation. Keep in mind that the value must not be escaped.

Parameters:
value - the value of this Literal.
Throws:
java.lang.NullPointerException - If the specified value is null.

Literal

public Literal(java.util.Date date)
Constructs a literal from a date.

Parameters:
date - The date to create a literal from.

Literal

public Literal(boolean value)
Method Detail

generateSapl

public void generateSapl(java.lang.StringBuilder builder)
Generates the s-apl representation of the literal. Properly escaped.

Specified by:
generateSapl in interface Object
Specified by:
generateSapl in interface Subject
Parameters:
builder - The StringBuilder on which the representation must be appended.

toString

public java.lang.String toString()
Returns the literal value.

Overrides:
toString in class java.lang.Object