org.apache.sling.scripting.javascript.wrapper
Class ScriptableProperty

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.apache.sling.scripting.javascript.wrapper.ScriptableBase
          extended by org.apache.sling.scripting.javascript.wrapper.ScriptableProperty
All Implemented Interfaces:
java.io.Serializable, SlingWrapper, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Wrapper

public class ScriptableProperty
extends ScriptableBase
implements SlingWrapper

Wrap a JCR Property as a Scriptable

See Also:
Serialized Form

Field Summary
static java.lang.String CLASSNAME
           
static java.lang.Class<?>[] WRAPPED_CLASSES
           
 
Fields inherited from class org.apache.sling.scripting.javascript.wrapper.ScriptableBase
JSFUNC_PREFIX
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
ScriptableProperty()
           
 
Method Summary
 java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
           
 java.lang.String getClassName()
          The name of the JavaScript host object "class"
protected  java.lang.Class<?> getStaticType()
           
 int getType()
           
 java.lang.Class<?>[] getWrappedClasses()
          The list of Java classes wrapped by this wrapper
protected  java.lang.Object getWrappedObject()
           
 void jsConstructor(java.lang.Object res)
           
 java.lang.Object jsFunction_toString()
           
 java.lang.Object jsFunction_valueOf(java.lang.String hint)
           
 java.lang.Object jsGet_boolean()
           
 java.lang.Object jsGet_date()
           
 java.lang.Object jsGet_definition()
           
 int jsGet_depth()
           
 java.lang.Object jsGet_double()
           
 java.lang.Class<?> jsGet_javascriptWrapperClass()
          Used in testing, to check that the right wrapper is used.
 java.lang.Object jsGet_length()
           
 long[] jsGet_lengths()
           
 java.lang.Object jsGet_long()
           
 boolean jsGet_modified()
           
 java.lang.String jsGet_name()
           
 boolean jsGet_new()
           
 java.lang.Object jsGet_node()
           
 java.lang.Object jsGet_parent()
           
 java.lang.String jsGet_path()
           
 java.lang.Object jsGet_session()
           
 java.lang.Object jsGet_stream()
           
 java.lang.Object jsGet_string()
           
 java.lang.Object jsGet_value()
           
 java.lang.Object jsGet_values()
           
 java.lang.String toString()
           
 java.lang.Object unwrap()
           
 
Methods inherited from class org.apache.sling.scripting.javascript.wrapper.ScriptableBase
getNative
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values

WRAPPED_CLASSES

public static final java.lang.Class<?>[] WRAPPED_CLASSES
Constructor Detail

ScriptableProperty

public ScriptableProperty()
Method Detail

jsConstructor

public void jsConstructor(java.lang.Object res)

getClassName

public java.lang.String getClassName()
Description copied from interface: SlingWrapper
The name of the JavaScript host object "class"

Specified by:
getClassName in interface SlingWrapper
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

getWrappedClasses

public java.lang.Class<?>[] getWrappedClasses()
Description copied from interface: SlingWrapper
The list of Java classes wrapped by this wrapper

Specified by:
getWrappedClasses in interface SlingWrapper

jsGet_value

public java.lang.Object jsGet_value()

jsGet_values

public java.lang.Object jsGet_values()

jsGet_string

public java.lang.Object jsGet_string()

jsGet_stream

public java.lang.Object jsGet_stream()

jsGet_long

public java.lang.Object jsGet_long()

jsGet_double

public java.lang.Object jsGet_double()

jsGet_date

public java.lang.Object jsGet_date()

jsGet_boolean

public java.lang.Object jsGet_boolean()

jsGet_node

public java.lang.Object jsGet_node()

jsGet_length

public java.lang.Object jsGet_length()

jsGet_lengths

public long[] jsGet_lengths()

jsGet_definition

public java.lang.Object jsGet_definition()

getType

public int getType()

jsGet_session

public java.lang.Object jsGet_session()

jsGet_path

public java.lang.String jsGet_path()

jsGet_name

public java.lang.String jsGet_name()

jsGet_parent

public java.lang.Object jsGet_parent()

jsGet_depth

public int jsGet_depth()

jsGet_new

public boolean jsGet_new()

jsGet_modified

public boolean jsGet_modified()

jsGet_javascriptWrapperClass

public java.lang.Class<?> jsGet_javascriptWrapperClass()
Description copied from class: ScriptableBase
Used in testing, to check that the right wrapper is used. For some reason, defining the method here didn't work, it had to be defined in all descendant classes.

Specified by:
jsGet_javascriptWrapperClass in class ScriptableBase

jsFunction_valueOf

public java.lang.Object jsFunction_valueOf(java.lang.String hint)

get

public java.lang.Object get(java.lang.String name,
                            org.mozilla.javascript.Scriptable start)
Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject

jsFunction_toString

public java.lang.Object jsFunction_toString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

unwrap

public java.lang.Object unwrap()
Specified by:
unwrap in interface org.mozilla.javascript.Wrapper

getStaticType

protected java.lang.Class<?> getStaticType()
Specified by:
getStaticType in class ScriptableBase
Returns:
the static type to use for NativeJavaObject wrapping

getWrappedObject

protected java.lang.Object getWrappedObject()
Specified by:
getWrappedObject in class ScriptableBase
Returns:
the Java object that we're wrapping, used to create a NativeJavaObject instance for default wrapping.


Copyright © 2007-2009. All Rights Reserved.