Package org.apache.felix.ipojo.metadata

Examples of org.apache.felix.ipojo.metadata.Attribute


    }
   
   
    private Element getNothing() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
View Full Code Here


        return elem;
    }
   
    private Element getNoTransition() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        callback.addAttribute(new Attribute("method", "start"));
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }
   
    private Element getNoMethod() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        callback.addAttribute(new Attribute("transition", "validate"));
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }
   
    private Element getBadMethod() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        callback.addAttribute(new Attribute("transition", "validate"));
        callback.addAttribute(new Attribute("method", "start_")); // Missing method.
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }
   
    private Element getBadMethod2() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        callback.addAttribute(new Attribute("transition", "invalidate"));
        callback.addAttribute(new Attribute("method", "stop_")); // Missing method.
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }
   
    private Element getBadTransition() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));
       
        Element callback = new Element("callback", "");
        callback.addAttribute(new Attribute("method", "start"));
        callback.addAttribute(new Attribute("transition", "validate_"));
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

            Enumeration e = m_properties.keys();
            while (e.hasMoreElements()) {
                String field = (String) e.nextElement();
                Element prop = new Element("property", ""); // Create an element for the actual property.
                // Add two attribute (the field and the value).
                prop.addAttribute(new Attribute("field", field));
                prop.addAttribute(new Attribute("value", (String) m_properties.get(field)));
                elem.addElement(prop); // Attach the current element to the root element.
            }
            return elem;
        }
View Full Code Here

    public Element getElement() {
        ensureValidity();

        Element dep = new Element("requires", "");
        if (m_specification != null) {
            dep.addAttribute(new Attribute("specification", m_specification));
        }
        if (m_filter != null) {
            dep.addAttribute(new Attribute("filter", m_filter));
        }
        if (m_field != null) {
            dep.addAttribute(new Attribute("field", m_field));
        }
        if (m_parameterIndex != -1) {
          dep.addAttribute(new Attribute("constructor-parameter",
              Integer.toString(m_parameterIndex)));
        }
        if (m_bind != null) {
            Element cb = new Element("callback", "");
            cb.addAttribute(new Attribute("type", "bind"));
            cb.addAttribute(new Attribute("method", m_bind));
            dep.addElement(cb);
        }
        if (m_unbind != null) {
            Element cb = new Element("callback", "");
            cb.addAttribute(new Attribute("type", "unbind"));
            cb.addAttribute(new Attribute("method", m_unbind));
            dep.addElement(cb);
        }
        if (m_modified != null) {
            Element cb = new Element("callback", "");
            cb.addAttribute(new Attribute("type", "modified"));
            cb.addAttribute(new Attribute("method", m_modified));
            dep.addElement(cb);
        }
        if (m_comparator != null) {
            dep.addAttribute(new Attribute("comparator", m_comparator));
        }
        if (m_di != null) {
            dep.addAttribute(new Attribute("default-implementation", m_di));
        }
        if (m_from != null) {
            dep.addAttribute(new Attribute("from", m_from));
        }
        if (m_id != null) {
            dep.addAttribute(new Attribute("id", m_id));
        }
        if (! m_nullable) {
            dep.addAttribute(new Attribute("nullable", "false"));
        }
        if (m_optional) {
            dep.addAttribute(new Attribute("optional", "true"));
        }
        if (m_aggregate) {
            dep.addAttribute(new Attribute("aggregate", "true"));
        }
        if (! m_proxy) {
            dep.addAttribute(new Attribute("proxy", "false"));
        }
        if (m_policy != -1) {
            if (m_policy == DYNAMIC) {
                dep.addAttribute(new Attribute("policy", "dynamic"));
            } else if (m_policy == STATIC) {
                dep.addAttribute(new Attribute("policy", "static"));
            } else if (m_policy == DYNAMIC_PRIORITY) {
                dep.addAttribute(new Attribute("policy", "dynamic-priority"));
            }
            // No other possibilities.
        }
        return dep;
    }
View Full Code Here

     */
    public Element getElement() {
        ensureValidity();
        Element element = new Element("property", "");
        if (m_name != null) {
            element.addAttribute(new Attribute("name", m_name));
        }
        if (m_type != null) {
            element.addAttribute(new Attribute("type", m_type));
        }
        if (m_value != null) {
            element.addAttribute(new Attribute("value", m_value));
        }
        if (m_field != null) {
            element.addAttribute(new Attribute("field", m_field));
        }
        if (m_mandatory) {
            element.addAttribute(new Attribute("mandatory", new Boolean(m_mandatory).toString()));
        }
        if (m_immutable) {
            element.addAttribute(new Attribute("immutable", new Boolean(m_immutable).toString()));
        }
        return element;
    }
View Full Code Here

     */
    public Element getElement() {
        ensureValidity();
        Element element = new Element("provides", "");
        if (m_specifications != null) {
            element.addAttribute(new Attribute("specifications", getSpecificationsArray()));
        }
        element.addAttribute(new Attribute("strategy", getStringStrategy()));
        for (int i = 0; i < m_properties.size(); i++) {
            element.addElement(((ServiceProperty) m_properties.get(i)).getElement());
        }

        if (m_controller != null) {
            Element ctrl = new Element("controller", "");
            ctrl.addAttribute(new Attribute("field", m_controller));
            ctrl.addAttribute(new Attribute("value", String.valueOf(m_controllerValue)));
            element.addElement(ctrl);
        }

        if (m_postRegistrationCallback != null) {
          element.addAttribute(new Attribute("post-registration", m_postRegistrationCallback));
        }
        if (m_postUnregistrationCallback != null) {
          element.addAttribute(new Attribute("post-unregistration", m_postUnregistrationCallback));
        }

        return element;
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.metadata.Attribute

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.