From 98e2821b38a775737e42a2479a6bc65107210859 Mon Sep 17 00:00:00 2001 From: Elliot Kroo Date: Thu, 11 Mar 2010 15:21:30 -0800 Subject: reorganizing the first level of folders (trunk/branch folders are not the git way :) --- .../org/mozilla/javascript/WrapFactory.html | 400 +++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html (limited to 'infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html') diff --git a/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html new file mode 100644 index 0000000..675c456 --- /dev/null +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html @@ -0,0 +1,400 @@ + + + + + + +WrapFactory (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class WrapFactory

+
+java.lang.Object
+  extended by org.mozilla.javascript.WrapFactory
+
+
+
+
public class WrapFactory
extends java.lang.Object
+ + +

+Embeddings that wish to provide their own custom wrappings for Java + objects may extend this class and call + Context.setWrapFactory(WrapFactory) + Once an instance of this class or an extension of this class is enabled + for a given context (by calling setWrapFactory on that context), Rhino + will call the methods of this class whenever it needs to wrap a value + resulting from a call to a Java method or an access to a Java field. +

+ +

+

+
Since:
+
1.5 Release 4
+
See Also:
Context.setWrapFactory(WrapFactory)
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
WrapFactory() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanisJavaPrimitiveWrap() + +
+          Return false if result of Java method, which is instance of + String, Number, Boolean and + Character, should be used directly as JavaScript primitive + type.
+ voidsetJavaPrimitiveWrap(boolean value) + +
+           
+ java.lang.Objectwrap(Context cx, + Scriptable scope, + java.lang.Object obj, + java.lang.Class staticType) + +
+          Wrap the object.
+ ScriptablewrapAsJavaObject(Context cx, + Scriptable scope, + java.lang.Object javaObject, + java.lang.Class staticType) + +
+          Wrap Java object as Scriptable instance to allow full access to its + methods and fields from JavaScript.
+ ScriptablewrapNewObject(Context cx, + Scriptable scope, + java.lang.Object obj) + +
+          Wrap an object newly created by a constructor call.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+WrapFactory

+
+public WrapFactory()
+
+
+ + + + + + + + +
+Method Detail
+ +

+wrap

+
+public java.lang.Object wrap(Context cx,
+                             Scriptable scope,
+                             java.lang.Object obj,
+                             java.lang.Class staticType)
+
+
Wrap the object. +

+ The value returned must be one of +

    +
  • java.lang.Boolean
  • +
  • java.lang.String
  • +
  • java.lang.Number
  • +
  • org.mozilla.javascript.Scriptable objects
  • +
  • The value returned by Context.getUndefinedValue()
  • +
  • null
  • +
+

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
obj - the object to be wrapped. Note it can be null.
staticType - type hint. If security restrictions prevent to wrap + object based on its class, staticType will be used instead. +
Returns:
the wrapped value.
+
+
+
+ +

+wrapNewObject

+
+public Scriptable wrapNewObject(Context cx,
+                                Scriptable scope,
+                                java.lang.Object obj)
+
+
Wrap an object newly created by a constructor call. +

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
obj - the object to be wrapped +
Returns:
the wrapped value.
+
+
+
+ +

+wrapAsJavaObject

+
+public Scriptable wrapAsJavaObject(Context cx,
+                                   Scriptable scope,
+                                   java.lang.Object javaObject,
+                                   java.lang.Class staticType)
+
+
Wrap Java object as Scriptable instance to allow full access to its + methods and fields from JavaScript. +

+ wrap(Context, Scriptable, Object, Class) and + wrapNewObject(Context, Scriptable, Object) call this method + when they can not convert javaObject to JavaScript primitive + value or JavaScript array. +

+ Subclasses can override the method to provide custom wrappers + for Java objects. +

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
javaObject - the object to be wrapped
staticType - type hint. If security restrictions prevent to wrap + object based on its class, staticType will be used instead. +
Returns:
the wrapped value which shall not be null
+
+
+
+ +

+isJavaPrimitiveWrap

+
+public final boolean isJavaPrimitiveWrap()
+
+
Return false if result of Java method, which is instance of + String, Number, Boolean and + Character, should be used directly as JavaScript primitive + type. + By default the method returns true to indicate that instances of + String, Number, Boolean and + Character should be wrapped as any other Java object and + scripts can access any Java method available in these objects. + Use setJavaPrimitiveWrap(boolean) to change this. +

+

+
+
+
+
+ +

+setJavaPrimitiveWrap

+
+public final void setJavaPrimitiveWrap(boolean value)
+
+
+
See Also:
isJavaPrimitiveWrap()
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3