1 16 package org.apache.cocoon.components.flow.javascript; 17 18 import org.apache.commons.jxpath.ri.model.NodePointerFactory; 19 import org.apache.commons.jxpath.ri.model.NodePointer; 20 import org.apache.commons.jxpath.ri.QName; 21 import java.util.Locale ; 22 import org.mozilla.javascript.Scriptable; 23 24 28 public class ScriptablePointerFactory implements NodePointerFactory { 29 30 public int getOrder() { 31 return 1; 32 } 33 34 public NodePointer createNodePointer(QName name, Object object, 35 Locale locale) { 36 if (object instanceof Scriptable) { 37 return new ScriptablePointer(name, (Scriptable)object, locale); 38 } 39 return null; 40 } 41 42 public NodePointer createNodePointer(NodePointer parent, 43 QName name, Object object) { 44 if (object instanceof Scriptable) { 45 return new ScriptablePointer(parent, name, 46 (Scriptable)object); 47 } 48 return null; 49 } 50 } 51 | Popular Tags |