org.jruby.embed
Enum AttributeName

java.lang.Object
  extended by java.lang.Enum<AttributeName>
      extended by org.jruby.embed.AttributeName
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AttributeName>

public enum AttributeName
extends java.lang.Enum<AttributeName>

Predefined keys for an attribute map that ScriptingContainer has. Usage example:

     ScriptingContainer container = new ScriptingContainer();
     container.setAttribute(AttributeName.BASE_DIR, System.getProperty("user.dir");

Author:
Yoko Harada

Enum Constant Summary
BASE_DIR
          A key used in an attribute map to set a base directory.
ERROR_WRITER
          A key used in an attribute map to set an error writer.
LINENUMBER
          A key used in an attribute map to set a line number in error message.
READER
          A key used in an attribute map to set a reader.
RECEIVER
          A key used in an attribute map to set a receiver object for sharing variables.
SHARING_VARIABLES
          A key used in an attribute map to turn on/off sharing variable feature.
TERMINATION
          A key used in an attribute map to turn on/off termination.
UNICODE_ESCAPE
          A key used in an attribute map to specify that the script to be parsed has unicode escape in it.
WRITER
          A key used in an attribute map to set a writer.
 
Method Summary
static AttributeName getType(java.lang.String fqpn)
          Returns a fully qualified attribute name that corresponds to a given enumerated type identifier.
 java.lang.String toString()
          Returns the fully qualified attribute name of this enum constant.
static AttributeName valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AttributeName[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READER

public static final AttributeName READER
A key used in an attribute map to set a reader. This attribute can be set using a System property, org.jruby.embed.reader.


WRITER

public static final AttributeName WRITER
A key used in an attribute map to set a writer. This attribute can be set using a System property, org.jruby.embed.writer.


ERROR_WRITER

public static final AttributeName ERROR_WRITER
A key used in an attribute map to set an error writer. This attribute can be set using a System property, org.jruby.embed.errorwriter.


BASE_DIR

public static final AttributeName BASE_DIR
A key used in an attribute map to set a base directory. This attribute can be set using a System property, org.jruby.embed.basedir.


LINENUMBER

public static final AttributeName LINENUMBER
A key used in an attribute map to set a line number in error message. This attribute is for JSR223 only. This attribute can be set using a System property, org.jruby.embed.linenumber.


UNICODE_ESCAPE

public static final AttributeName UNICODE_ESCAPE
A key used in an attribute map to specify that the script to be parsed has unicode escape in it. Default is false. This attribute can be set using a System property, org.jruby.embed.unicode.escpe.


SHARING_VARIABLES

public static final AttributeName SHARING_VARIABLES
A key used in an attribute map to turn on/off sharing variable feature. Default is true. If false is set, sharing variables goes off, and better performance will be expected. This attribute can be set using a System property, org.jruby.embed.sharing.variables.


TERMINATION

public static final AttributeName TERMINATION
A key used in an attribute map to turn on/off termination. This attribute is for JSR223 only. Default is false, which means JRubyEngine doesn't terminate any state and doesn't execute at_exit blocks. If true is set, JRubyEngine terminates the state as well as executes at_exit blocks. This attribute can be set using a System property, org.jruby.embed.termination.


RECEIVER

public static final AttributeName RECEIVER
A key used in an attribute map to set a receiver object for sharing variables. This attribute is for JSR223 only. This attribute can be set using a System property, org.jruby.embed.receiver.

Method Detail

values

public static AttributeName[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AttributeName c : AttributeName.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AttributeName valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toString

public java.lang.String toString()
Returns the fully qualified attribute name of this enum constant.

Overrides:
toString in class java.lang.Enum<AttributeName>
Returns:
a fully qualified attribute name

getType

public static AttributeName getType(java.lang.String fqpn)
Returns a fully qualified attribute name that corresponds to a given enumerated type identifier.

Parameters:
fqan - fully qualified attribute name
Returns:
a matched enumerated type identifier


Copyright © 2002-2009 JRuby Team. All Rights Reserved.