net.sf.tomp.xtcl.command
Class PropertiesCommand

java.lang.Object
  extended by net.sf.tomp.xtcl.command.AbstractCommand
      extended by net.sf.tomp.xtcl.command.VarCommand
          extended by net.sf.tomp.xtcl.command.PropertiesCommand
All Implemented Interfaces:
Command

public class PropertiesCommand
extends VarCommand

Creates java.util.Properties and puts it into Context.

Author:
tomp

Field Summary
 
Fields inherited from class net.sf.tomp.xtcl.command.VarCommand
var
 
Constructor Summary
PropertiesCommand()
           
 
Method Summary
 int execute(Context context)
          if fileNameOrRef == null, create Properties from String 'body' otherwise from File referenced by 'fileNameOrRef'
 java.lang.String getBody()
           
 java.lang.String getFileNameOrRef()
           
 void setBody(java.lang.String b)
          Set the command (sequence) found in this template body
 void setFileNameOrRef(java.lang.String b)
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.tomp.xtcl.command.VarCommand
setVar
 
Methods inherited from class net.sf.tomp.xtcl.command.AbstractCommand
done, initParameters, listArray, listList, listMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertiesCommand

public PropertiesCommand()
Method Detail

execute

public int execute(Context context)
            throws java.lang.Exception
if fileNameOrRef == null, create Properties from String 'body' otherwise from File referenced by 'fileNameOrRef'

Specified by:
execute in interface Command
Overrides:
execute in class AbstractCommand
Parameters:
context - Context this command will be executed in.
Returns:
always 0 == success, OK
Throws:
java.lang.Exception - only if I/O error occurs when reporting the result to user.

getBody

public java.lang.String getBody()
Returns:
the body of the text from which the Properties will be created.

getFileNameOrRef

public java.lang.String getFileNameOrRef()
Returns:
Returns the fileNameOrRef.

setBody

public void setBody(java.lang.String b)
Set the command (sequence) found in this template body

Parameters:
c - the command from the body

setFileNameOrRef

public void setFileNameOrRef(java.lang.String b)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
"PROPERTIES " + var + " <- " + (fileNameOrRef == null ? "{...}" : fileNameOrRef);


Copyright © 2004-2005 Masaryk University in Brno, Faculty of Informatics, Czech Republic. All Rights Reserved.