Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.AbstractFactory


        JXPathContext context,
        QName name,
        int index) {
        Object collection = createCollection(context, index);
        if (!isActual() || (index != 0 && index != WHOLE_COLLECTION)) {
            AbstractFactory factory = getAbstractFactory(context);
            boolean success =
                factory.createObject(
                    context,
                    this,
                    collection,
                    getName().toString(),
                    index);
View Full Code Here


    public NodePointer createPath(JXPathContext context) {
        // Ignore the name passed to us, use our own data
        Object collection = getBaseValue();
        if (collection == null) {
            AbstractFactory factory = getAbstractFactory(context);
            boolean success =
                factory.createObject(
                    context,
                    this,
                    getBean(),
                    getPropertyName(),
                    0);
View Full Code Here

     * Get the AbstractFactory associated with the specified JXPathContext.
     * @param context JXPathContext
     * @return AbstractFactory
     */
    protected AbstractFactory getAbstractFactory(JXPathContext context) {
        AbstractFactory factory = context.getFactory();
        if (factory == null) {
            throw new JXPathException(
                "Factory is not set on the JXPathContext - cannot create path: "
                    + asPath());
        }
View Full Code Here

            getImmediateNode());
    }

    public NodePointer createPath(JXPathContext context) {
        if (getImmediateNode() == null) {
            AbstractFactory factory = getAbstractFactory(context);
            int inx = (index == WHOLE_COLLECTION ? 0 : index);
            boolean success =
                factory.createObject(
                    context,
                    this,
                    getBean(),
                    getPropertyName(),
                    inx);
View Full Code Here

                                           "\nBinding doesn't support having namespace-declarations without explicit prefixes.",
                                           DomHelper.getLocationObject(bindingElm));
            }

            String jxPathFactoryName = bindingElm.getAttribute("jxpath-factory");
            AbstractFactory jxPathFactory = null;
            if (jxPathFactoryName != null && jxPathFactoryName.trim().length() > 0) {
                try {
                    Class jxPathFactoryClass = JXPathBindingBuilderBase.class.getClassLoader().loadClass(jxPathFactoryName);
                    jxPathFactory = (AbstractFactory)jxPathFactoryClass.newInstance();
                } catch (Exception e) {
View Full Code Here

        if (extra.direction != null) {
            // was defined
            direction = extra.direction;
        }

        AbstractFactory jxPathFactory = existing.jxPathFactory;
        if (extra.jxPathFactory != null) {
            jxPathFactory = extra.jxPathFactory;
        }

        return new CommonAttributes(extra.location, direction, strLeniency, extra.nsDeclarations, jxPathFactory);
View Full Code Here

        JXPathContext jxpc;
        if (!(objModel instanceof JXPathContext)) {
            jxpc = JXPathContext.newContext(objModel);
            jxpc.setLenient(true);

            AbstractFactory jxPathFactory;
            if (commonAtts.jxPathFactory != null)
                jxPathFactory = commonAtts.jxPathFactory;
            else
                jxPathFactory = new BindingJXPathFactory();
            jxpc.setFactory(jxPathFactory);
View Full Code Here

        this.value = value;
    }

    public NodePointer createPath(JXPathContext context){
        if (getNodeValue() == null){
            AbstractFactory factory = getAbstractFactory(context);
            int inx = (index == WHOLE_COLLECTION ? 0 : index);
            if (!factory.createObject(context, this, getBean(),
                    getPropertyName(), inx)){
                throw new JXPathException(
                    "Factory could not create an object for path: " + asPath());
            }
            baseValue = UNINITIALIZED;
View Full Code Here

        if (index < 0){
            throw new JXPathException("Index is less than 1: " + asPath());
        }

        if (index >= getLength()){
            AbstractFactory factory = getAbstractFactory(context);
            if (!factory.createObject(context, this, getBean(),
                    getPropertyName(), index)){
                throw new JXPathException("Factory could not create path " +
                        asPath());
            }
        }
View Full Code Here

        }
        return propertyDescriptors;
    }

    private AbstractFactory getAbstractFactory(JXPathContext context){
        AbstractFactory factory = context.getFactory();
        if (factory == null){
            throw new JXPathException("Factory is not set on the " +
                "JXPathContext - cannot create path: " + asPath());
        }
        return factory;
View Full Code Here

TOP

Related Classes of org.apache.commons.jxpath.AbstractFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.