use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class ManipulatedMetadataFilterTestCase method testFilterInstanceManagerSetter.
public void testFilterInstanceManagerSetter() throws Exception {
Element main = new Element("test", null);
main.addAttribute(new Attribute("name", "_setInstanceManager"));
Assert.assertTrue(filter.accept(main));
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class ManipulatedMetadataFilterTestCase method testFilterInstanceManagerValue.
public void testFilterInstanceManagerValue() throws Exception {
Element main = new Element("test", null);
main.addAttribute(new Attribute("name", InstanceManager.class.getName()));
Assert.assertTrue(filter.accept(main));
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class ManipulatedMetadataFilterTestCase method testFilterPrefixedMethod.
public void testFilterPrefixedMethod() throws Exception {
Element main = new Element("test", null);
main.addAttribute(new Attribute("name", ClassManipulator.PREFIX + "PropertyName"));
Assert.assertTrue(filter.accept(main));
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class CheckFieldConsistencyResultVisitorTestCase method newManipulationElement.
private Element newManipulationElement(boolean complete) {
Element manipulation = new Element("manipulation", null);
if (complete) {
Element field = new Element("field", null);
field.addAttribute(new Attribute("name", "property"));
manipulation.addElement(field);
}
return manipulation;
}
use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.
the class Service method getElement.
/**
* Gets the provided service element.
* @return the 'provides' element.
*/
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;
}
Aggregations