Package org.netbeans.modules.schema2beans

Examples of org.netbeans.modules.schema2beans.BaseBean


            len = props.length;
        if (len > 0)
            retVal = new java.util.ArrayList();
        for (int i = 0; i < len; i++) {
            // get the bean that is the property's parent.
            BaseBean candidate = gm.getPropertyParent(props[i]);
            if (type.isInstance(candidate))
                retVal.add(candidate);
        }
        return retVal;
    }
View Full Code Here


    }


    public int getCardinal(){
        String name = baseBean.name();
        BaseBean parent = baseBean.parent();
        BaseProperty baseProperty = parent.getProperty(name);
        return baseProperty.getInstanceType();
    }
View Full Code Here

        ///Object[] arguments = new Object[]{"Name", baseBean.name()};  //NOI18N
        ///System.out.println(MessageFormat.format(format, arguments));
        ///arguments = new Object[]{"FullName", baseBean.fullName()};   //NOI18N
        ///System.out.println(MessageFormat.format(format, arguments));

        BaseBean bean =  baseBean;
        BaseBean parentBean = null;
        String xpath = bean.dtdName();
        ///boolean root =  bean.isRoot();
        boolean root = isRootElement(bean);
        parentBean = bean.parent();
        while(!root){
            xpath = parentBean.dtdName() + Constants.XPATH_DELIMITER + xpath;
            bean = parentBean;
            parentBean = bean.parent();
            ///root = bean.isRoot();
            root = isRootElement(bean);
        }
View Full Code Here

        return xpath;
    }


    public String getIndexedXPath() {
        BaseBean bean =  baseBean;
        BaseBean parentBean = null;
        String xpath = bean.dtdName();
        int index = getIndex(baseBean);
        if(index != -1){
            xpath = utils.getIndexedName(xpath,  index);
        }

        boolean root = isRootElement(bean);
        parentBean = bean.parent();

        String name = null;
        while(!root){
            name = parentBean.dtdName();
            index = getIndex(parentBean);
            if(index != -1) {
                name = utils.getIndexedName(name, index);
            }
            xpath = name + Constants.XPATH_DELIMITER + xpath;
View Full Code Here

        return xpath;
    }


    boolean isRootElement(BaseBean bean){
        BaseBean parent = bean.parent();
        boolean root;
        if(parent.name().equals(bean.name())){
            root = true;
        } else {
            root = false;
        }
        return root;
View Full Code Here

    int getIndex(BaseBean baseBean){
        int index = -1;
        boolean root = isRootElement(baseBean);
        if(!root){
            String name = baseBean.name();
            BaseBean parent = baseBean.parent();
            if(parent != null) {
                index = parent.indexOf(name, baseBean);
            }
        }
        return index;
    }   
View Full Code Here

    }
   
    /** helper method */
    private static BaseBean findSingleCompatibleBean(String argOneName, BaseBean argOne, String argTwoName,
            String argTwo, String propName, Class type) {
        BaseBean retVal = null;
        if (null == argTwo || argTwo.length() < 1)
            throw new IllegalArgumentException(argTwoName);
       
        List l = findCompatibleBeansWithValue(argOne, propName, argTwo,
            type);
View Full Code Here

            len = props.length;
        if (len > 0)
            retVal = new ArrayList();
        for (int i = 0; i < len; i++) {
            // get the bean that is the property's parent.
            BaseBean candidate = gm.getPropertyParent(props[i]);
            if (type.isInstance(candidate))
                retVal.add(candidate);
        }
        return retVal;
    }
View Full Code Here

    }
   
    /** helper method */
    private static BaseBean findSingleCompatibleBean(String argOneName, BaseBean argOne, String argTwoName,
            String argTwo, String propName, Class type) {
        BaseBean retVal = null;
        if (null == argTwo || argTwo.length() < 1)
            throw new IllegalArgumentException(argTwoName);
       
        List l = findCompatibleBeansWithValue(argOne, propName, argTwo,
            type);
View Full Code Here

            len = props.length;
        if (len > 0)
            retVal = new ArrayList();
        for (int i = 0; i < len; i++) {
            // get the bean that is the property's parent.
            BaseBean candidate = gm.getPropertyParent(props[i]);
            if (type.isInstance(candidate))
                retVal.add(candidate);
        }
        return retVal;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.schema2beans.BaseBean

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.