Package org.apache.felix.ipojo.metadata

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


    public Element getElement() {
        ensureValidity();
       
        Element dep = new Element("requires", "org.apache.felix.ipojo.handler.temporal");
        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_onTimeout != null) {
            dep.addAttribute(new Attribute("omTimeout", m_onTimeout));
        }
        if (m_timeout != null) {
            dep.addAttribute(new Attribute("timeout", m_timeout));
        }
        if (m_proxy) {
            dep.addAttribute(new Attribute("proxy", "true"));
        }
       
        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_method != null) {
            element.addAttribute(new Attribute("method", m_method));
        }
        if (m_parameterIndex != -1) {
          element.addAttribute(new Attribute("constructor-parameter",
              Integer.toString(m_parameterIndex)));
        }
        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 dep = new Element("provides", "");
        dep.addAttribute(new Attribute("action", "export"));
      
        dep.addAttribute(new Attribute("specification", m_specification));

       
        if (m_filter != null) {
            dep.addAttribute(new Attribute("filter", m_filter));
        }
        if (m_comparator != null) {
            dep.addAttribute(new Attribute("comparator", m_comparator));
        }
      
        if (m_optional) {
            dep.addAttribute(new Attribute("optional", "true"));
        }
        if (m_aggregate) {
            dep.addAttribute(new Attribute("aggregate", "true"));
        }

        if (m_policy == DependencyModel.DYNAMIC_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "dynamic"));
        } else if (m_policy == DependencyModel.STATIC_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "static"));
        } else if (m_policy == DependencyModel.DYNAMIC_PRIORITY_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "dynamic-priority"));
        }
       
        return dep;
    }
View Full Code Here

     */
    public Element getElement() {
        ensureValidity();
       
        Element dep = new Element("provides", "");
        dep.addAttribute(new Attribute("action", "implement"));
      
        dep.addAttribute(new Attribute("specification", m_specification));

        for (int i = 0; i < m_delegation.size(); i++) {
            dep.addElement((Element) m_delegation.get(i));
        }
       
View Full Code Here

     * @param policy the delegation policy
     * @return the current exported service.
     */
    public ProvidedService setDelegation(String method, String policy) {
        Element element = new Element("delegation", "");
        element.addAttribute(new Attribute("method", method));
        element.addAttribute(new Attribute("policy", policy));
        m_delegation.add(element);
        return this;
    }
View Full Code Here

     */
    public Element getElement() {
        ensureValidity();

        Element dep = new Element("subservice", "");
        dep.addAttribute(new Attribute("action", "instantiate"));

        dep.addAttribute(new Attribute("specification", m_specification));

        if (m_filter != null) {
            dep.addAttribute(new Attribute("filter", m_filter));
        }
        if (m_comparator != null) {
            dep.addAttribute(new Attribute("comparator", m_comparator));
        }

        if (m_optional) {
            dep.addAttribute(new Attribute("optional", "true"));
        }
        if (m_aggregate) {
            dep.addAttribute(new Attribute("aggregate", "true"));
        }

        if (m_policy == DependencyModel.DYNAMIC_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "dynamic"));
        } else if (m_policy == DependencyModel.STATIC_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "static"));
        } else if (m_policy == DependencyModel.DYNAMIC_PRIORITY_BINDING_POLICY) {
            dep.addAttribute(new Attribute("policy", "dynamic-priority"));
        }

        for (int i = 0; i < m_conf.size(); i++) {
            Element elem = (Element) m_conf.get(i);
            dep.addElement(elem);
View Full Code Here

     * @return the current instantiated sub-service
     */
    public InstantiatedService addProperty(String name, String value) {
        Element elem = new Element("property", "");
        m_conf.add(elem);
        elem.addAttribute(new Attribute("name", name));
        elem.addAttribute(new Attribute("value", value));
        return this;
    }
View Full Code Here

     * @param values the property value
     * @return the current instantiated sub-service
     */
    public InstantiatedService addProperty(String name, List values) {
        Element elem = new Element("property", "");
        elem.addAttribute(new Attribute("name", name));
        elem.addAttribute(new Attribute("type", "list"));

        m_conf.add(elem);

        for (int i = 0; i < values.size(); i++) {
            Object obj = values.get(i);
            Element e = new Element("property", "");
            elem.addElement(e);
            if (obj instanceof String) {
                e.addAttribute(new Attribute("value", obj.toString()));
            } else {
                // TODO
                throw new UnsupportedOperationException(
                        "Complex properties are not supported yet");
            }
View Full Code Here

     * @param values the property value
     * @return the current instantiated sub-service
     */
    public InstantiatedService addProperty(String name, String[] values) {
        Element elem = new Element("property", "");
        elem.addAttribute(new Attribute("name", name));
        elem.addAttribute(new Attribute("type", "array"));

        m_conf.add(elem);

        for (int i = 0; i < values.length; i++) {
            Object obj = values[i];
            Element e = new Element("property", "");
            elem.addElement(e);
            e.addAttribute(new Attribute("value", obj.toString()));
        }

        return this;
    }
View Full Code Here

     * @param values the property value
     * @return the current instantiated sub-service
     */
    public InstantiatedService addProperty(String name, Vector values) {
        Element elem = new Element("property", "");
        elem.addAttribute(new Attribute("name", name));
        elem.addAttribute(new Attribute("type", "vector"));

        m_conf.add(elem);

        for (int i = 0; i < values.size(); i++) {
            Object obj = values.get(i);
            Element e = new Element("property", "");
            elem.addElement(e);
            if (obj instanceof String) {
                e.addAttribute(new Attribute("value", obj.toString()));
            } else {
                // TODO
                throw new UnsupportedOperationException(
                        "Complex properties are not supported yet");
            }
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.