use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class MethodPropertyVisitor method visitEnd.
/**
* End of the visit.
* Append the computed element to the element element.
*
* @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
Element prop = visitEndCommon();
prop.addAttribute(new Attribute("method", m_method));
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class MethodPropertyVisitor method getPropertyElement.
private Element getPropertyElement() {
// Gather all the <property> Elements
Element[] props = m_parent.getElements("property");
Element prop = null;
for (int i = 0; props != null && prop == null && i < props.length; i++) {
// Get the first one with the good name
String name = props[i].getAttribute("name");
if (name != null && name.equals(m_name)) {
prop = props[i];
}
}
// Create the Element if not present
if (prop == null) {
prop = new Element("property", "");
m_parent.addElement(prop);
if (m_name != null) {
prop.addAttribute(new Attribute("name", m_name));
}
}
return prop;
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class ParameterPropertyVisitor method visitEnd.
/**
* End of the visit.
* Append the computed element to the element element.
*
* @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
Element prop = visitEndCommon();
String type = Type.getArgumentTypes(node.desc)[m_index].getClassName();
prop.addAttribute(new Attribute("type", type));
prop.addAttribute(new Attribute("constructor-parameter", Integer.toString(m_index)));
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class ServiceControllerVisitor method visit.
/**
* Visit one "simple" annotation.
* @param name : annotation name
* @param value : annotation value
* @see org.objectweb.asm.AnnotationVisitor#visit(java.lang.String, java.lang.Object)
*/
public void visit(String name, Object value) {
if (name.equals("value")) {
controller.addAttribute(new Attribute("value", value.toString()));
return;
}
if (name.equals("specification")) {
String spec = ((Type) value).getClassName();
controller.addAttribute(new Attribute("specification", spec));
}
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class UpdatedVisitor method visitEnd.
@Override
public void visitEnd() {
Element properties = Elements.getPropertiesElement(workbench);
properties.addAttribute(new Attribute("updated", name));
}
Aggregations