All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----edu.utah.janos.antsr.core.Entity
Summary |
public abstract class Entity extends java.lang.Object { // Fields 3protected int[] L; private static final String[] defaults; private String name; // Constructors 2 Entity(); Entity(String); // Methods 8 String getName();protected void log(int, String); void setArgs(KeyArgs) throws InvalidKeyArgsException; void setArgs(String[]) throws InvalidKeyArgsException; void setArgs(String[], int) throws InvalidKeyArgsException; void setName(String); public String toString(); String usage(); }
An Entity is an abstract class from which all Node-resident "things" are subclassed. For example, applications, channels, extensions and the node interface are all Entities.
Every entity has a name.
Every entity has a set of "arguments" it understands. These arguments are represented as string pairs: an argument name and argument value. Each subclass of entity can define its own arguments and their default values. At this level, the only argument is '-log' (defaults to '0'.)
See Also: utils.KeyArgs
Cross Reference |
Fields |
· defaults | Summary | Top |
private static final String[] defaults
Default arguments that are handled at the Entity level.
All subclasses should follow this pattern: a
public final static String[]
nameddefaults
so that, via reflection, usage information can be obtained in a generic manner.Subclasses should explicitly set the defaults to null.
See Also: setArgs
· name | Summary | Top |
private String name
Name of this entity.
· L | Summary | Top |
protected int[] L
Note: L is deprecated Use the Janos I/O Logging levels instead.
Constructors |
· Entity | Summary | Top |
Entity()
No-argument constructor for Entities created through Class.newInstance(). Results in an unnamed entity.
Name must be set through setName();
· Entity | Summary | Top |
Entity(String name)
Construct a named Entity.
Methods |
· getName | Summary | Top |
String getName()
· setName | Summary | Top |
void setName(String name)
· usage | Summary | Top |
String usage()
· setArgs | Summary | Top |
void setArgs(String[] ka) throws InvalidKeyArgsException
Set this Entity's arguments to the given array of strings. The array must contain an even number of Strings (i.e., a whole number of pairs).
Subclasses should override the setArgs(utils.KeyArgs) version of this method if they want to handle their own arguments.
Parameter Description ka the array of String arguments.
- Throws: Exception
- if there are unused arguments
· setArgs | Summary | Top |
void setArgs(String[] ka, int sk) throws InvalidKeyArgsException
Set this Entity's arguments to the given array of strings. The array must contain an even number of Strings (i.e., a whole number of pairs). Start at index 'sk', ignoring previous entries in the array.
Subclasses should override the setArgs(utils.KeyArgs) version of this method if they want to handle their own arguments.
Parameter Description ka the array of String arguments. sk the start key in the array.
- Throws: Exception
- if there are unused arguments
· setArgs | Summary | Top |
void setArgs(KeyArgs k) throws InvalidKeyArgsException
Set this Entity's arguments to the those specified in k. Default arguments are overriden if specified in k.
Since this is the last place that handles KeyArgs, if the there are any remaining arguments, an exception is thrown. Subclasses of Entity must 'strike()' any KeyArgs they consume before invoking this method.
Parameter Description k the arguments to use.
- Throws: Exception
- if there are extra arguments in k
See Also: utils.KeyArgs, logLevel
· log | Summary | Top |
protected void log(int level, String msg)
Note: log() is deprecated Use node.log() for real logging. Use TRACE macros for debugging.
· toString | Summary | Top |
public String toString()
- Overrides:
- toString in class Object
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7