1 16 package org.apache.commons.jxpath.ri.model.jdom; 17 18 import java.util.Locale ; 19 20 import org.apache.commons.jxpath.ri.QName; 21 import org.apache.commons.jxpath.ri.model.NodePointer; 22 import org.apache.commons.jxpath.ri.model.NodePointerFactory; 23 import org.jdom.Document; 24 import org.jdom.Element; 25 26 32 public class JDOMPointerFactory implements NodePointerFactory { 33 34 public static final int JDOM_POINTER_FACTORY_ORDER = 110; 35 36 public int getOrder() { 37 return JDOM_POINTER_FACTORY_ORDER; 38 } 39 40 public NodePointer createNodePointer( 41 QName name, Object bean, Locale locale) 42 { 43 if (bean instanceof Document) { 44 return new JDOMNodePointer(bean, locale); 45 } 46 else if (bean instanceof Element) { 47 return new JDOMNodePointer(bean, locale); 48 } 49 return null; 50 } 51 52 public NodePointer createNodePointer( 53 NodePointer parent, QName name, Object bean) 54 { 55 if (bean instanceof Document) { 56 return new JDOMNodePointer(parent, bean); 57 } 58 else if (bean instanceof Element) { 59 return new JDOMNodePointer(parent, bean); 60 } 61 return null; 62 } 63 } | Popular Tags |