Package org.apache.felix.ipojo.metadata

Examples of org.apache.felix.ipojo.metadata.Element.addAttribute()


                for (PropertyDefinition propertyDeclaration : declaration.getPropertyDefinitions()) {
                    Element definitionDescription = new Element("property", APAM_NAMESPACE);
                    definitionDescription.addAttribute(new Attribute("name", propertyDeclaration.getName()));
                    definitionDescription.addAttribute(new Attribute("type", propertyDeclaration.getType()));
                    if (propertyDeclaration.hasDefaultValue())
                        definitionDescription.addAttribute(new Attribute("value", propertyDeclaration.getDefaultValue().toString()));
                    definitionsDescription.addElement(definitionDescription);
                }
                componentDescription.addElement(definitionsDescription);

                Element propertiesDescription = new Element("properties", APAM_NAMESPACE);;
View Full Code Here


                componentDescription.addElement(definitionsDescription);

                Element propertiesDescription = new Element("properties", APAM_NAMESPACE);;
                for (Entry<String,String> propertyEntry : declaration.getProperties().entrySet()) {
                    Element propertyDescription = new Element("property", APAM_NAMESPACE);
                    propertyDescription.addAttribute(new Attribute("name", propertyEntry.getKey()));
                    if (propertyEntry.getValue() != null)
                        propertyDescription.addAttribute(new Attribute("value", propertyEntry.getValue().toString()));
                    propertiesDescription.addElement(propertyDescription);
                }
                componentDescription.addElement(propertiesDescription);
View Full Code Here

                Element propertiesDescription = new Element("properties", APAM_NAMESPACE);;
                for (Entry<String,String> propertyEntry : declaration.getProperties().entrySet()) {
                    Element propertyDescription = new Element("property", APAM_NAMESPACE);
                    propertyDescription.addAttribute(new Attribute("name", propertyEntry.getKey()));
                    if (propertyEntry.getValue() != null)
                        propertyDescription.addAttribute(new Attribute("value", propertyEntry.getValue().toString()));
                    propertiesDescription.addElement(propertyDescription);
                }
                componentDescription.addElement(propertiesDescription);

                description.addElement(componentDescription);
View Full Code Here

     */
    @Override
    public Element getDescription() {

    Element relationDescription = new Element("injection",  ApamComponentFactory.APAM_NAMESPACE);
    relationDescription.addAttribute(new Attribute("relation", relation.getIdentifier()));
    relationDescription.addAttribute(new Attribute("target", relation.getTarget().toString()));
    relationDescription.addAttribute(new Attribute("name", injection.getName()));
    relationDescription.addAttribute(new Attribute("type", injection.getRequiredResource().toString()));
    relationDescription.addAttribute(new Attribute("isAggregate", Boolean.toString(injection.acceptMultipleProviders())));
 
View Full Code Here

    @Override
    public Element getDescription() {

    Element relationDescription = new Element("injection",  ApamComponentFactory.APAM_NAMESPACE);
    relationDescription.addAttribute(new Attribute("relation", relation.getIdentifier()));
    relationDescription.addAttribute(new Attribute("target", relation.getTarget().toString()));
    relationDescription.addAttribute(new Attribute("name", injection.getName()));
    relationDescription.addAttribute(new Attribute("type", injection.getRequiredResource().toString()));
    relationDescription.addAttribute(new Attribute("isAggregate", Boolean.toString(injection.acceptMultipleProviders())));
 
    /*
 
View Full Code Here

    public Element getDescription() {

    Element relationDescription = new Element("injection",  ApamComponentFactory.APAM_NAMESPACE);
    relationDescription.addAttribute(new Attribute("relation", relation.getIdentifier()));
    relationDescription.addAttribute(new Attribute("target", relation.getTarget().toString()));
    relationDescription.addAttribute(new Attribute("name", injection.getName()));
    relationDescription.addAttribute(new Attribute("type", injection.getRequiredResource().toString()));
    relationDescription.addAttribute(new Attribute("isAggregate", Boolean.toString(injection.acceptMultipleProviders())));
 
    /*
     * show the current state of resolution. To avoid unnecessary
View Full Code Here

    Element relationDescription = new Element("injection",  ApamComponentFactory.APAM_NAMESPACE);
    relationDescription.addAttribute(new Attribute("relation", relation.getIdentifier()));
    relationDescription.addAttribute(new Attribute("target", relation.getTarget().toString()));
    relationDescription.addAttribute(new Attribute("name", injection.getName()));
    relationDescription.addAttribute(new Attribute("type", injection.getRequiredResource().toString()));
    relationDescription.addAttribute(new Attribute("isAggregate", Boolean.toString(injection.acceptMultipleProviders())));
 
    /*
     * show the current state of resolution. To avoid unnecessary
     * synchronization overhead make a copy of the current target services
View Full Code Here

    Element relationDescription = new Element("injection",  ApamComponentFactory.APAM_NAMESPACE);
    relationDescription.addAttribute(new Attribute("relation", relation.getIdentifier()));
    relationDescription.addAttribute(new Attribute("target", relation.getTarget().toString()));
    relationDescription.addAttribute(new Attribute("name", injection.getName()));
    relationDescription.addAttribute(new Attribute("type", injection.getRequiredResource().toString()));
    relationDescription.addAttribute(new Attribute("isAggregate", Boolean.toString(injection.acceptMultipleProviders())));
 
    /*
     * show the current state of resolution. To avoid unnecessary
     * synchronization overhead make a copy of the current target services
     * and do not use directly the field that can be concurrently modified
View Full Code Here

    Set<Component> resolutions = new HashSet<Component>();
    synchronized (this) {
        resolutions.addAll(targetServices);
    }
 
    relationDescription.addAttribute(new Attribute("resolved", Boolean.toString(!resolutions.isEmpty())));
    for (Component target : resolutions) {
        Element bindingDescription = new Element("binding",ApamComponentFactory.APAM_NAMESPACE);
        bindingDescription.addAttribute(new Attribute("target", target.getName()));
        relationDescription.addElement(bindingDescription);
    }
View Full Code Here

    }
 
    relationDescription.addAttribute(new Attribute("resolved", Boolean.toString(!resolutions.isEmpty())));
    for (Component target : resolutions) {
        Element bindingDescription = new Element("binding",ApamComponentFactory.APAM_NAMESPACE);
        bindingDescription.addAttribute(new Attribute("target", target.getName()));
        relationDescription.addElement(bindingDescription);
    }
 
    return relationDescription;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.