本文整理了Java中org.apache.felix.ipojo.metadata.Element.getName()
方法的一些代码示例,展示了Element.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getName()
方法的具体详情如下:
包路径:org.apache.felix.ipojo.metadata.Element
类名称:Element
方法名:getName
[英]Gets element name.
[中]获取元素名称。
代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo
private String initExtension() {
if (m_componentMetadata.getNameSpace() == null) {
return m_componentMetadata.getName();
}
return m_componentMetadata.getNameSpace() + ":" + m_componentMetadata.getName();
}
代码示例来源:origin: apache/felix
private boolean isInstance(Element element) {
return "instance".equals(element.getName());
}
}
代码示例来源:origin: apache/felix
private String initExtension() {
if (m_componentMetadata.getNameSpace() == null) {
return m_componentMetadata.getName();
}
return m_componentMetadata.getNameSpace() + ":" + m_componentMetadata.getName();
}
代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo
/**
* Gets the array of component type metadata.
* @return the component metadata (composite & component).
* An empty array is returned if no component type declaration.
* @throws ParseException if a parsing error occurs
*/
public Element[] getComponentsMetadata() throws ParseException {
Element[] elems = m_elements[0].getElements();
List list = new ArrayList();
for (int i = 0; i < elems.length; i++) {
if (!"instance".equals(elems[i].getName())) {
list.add(elems[i]);
}
}
return (Element[]) list.toArray(new Element[list.size()]);
}
代码示例来源:origin: apache/felix
private void startElement(Element element, StringBuilder builder) {
// Default namespace is empty
String namespace = "";
if (element.getNameSpace() != null) {
namespace = element.getNameSpace() + ":";
}
builder.append(namespace)
.append(element.getName())
.append(" { ");
}
代码示例来源:origin: apache/felix
/**
* Gets the array of component type metadata.
* @return the component metadata (composite & component).
* An empty array is returned if no component type declaration.
* @throws ParseException if a parsing error occurs
*/
public Element[] getComponentsMetadata() throws ParseException {
Element[] elems = m_elements[0].getElements();
List list = new ArrayList();
for (int i = 0; i < elems.length; i++) {
if (!"instance".equals(elems[i].getName())) {
list.add(elems[i]);
}
}
return (Element[]) list.toArray(new Element[list.size()]);
}
代码示例来源:origin: apache/felix
/**
* Computes required handlers. This method does not manipulate any
* non-immutable fields, so does not need to be synchronized.
* This method is overridden to avoid using the same detection rules
* than 'primitive' components. Indeed, architecture is disable by default,
* and a handler is never immediate.
* @return the required handler list.
*/
public List<RequiredHandler> getRequiredHandlerList() {
List<RequiredHandler> list = new ArrayList<RequiredHandler>();
Element[] elems = m_componentMetadata.getElements();
for (int i = 0; i < elems.length; i++) {
Element current = elems[i];
if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
RequiredHandler req = new RequiredHandler(current.getName(),
current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
}
}
}
// Unlike normal components, the architecture is enable only when
// specified.
String arch = m_componentMetadata.getAttribute("architecture");
if (arch != null && arch.equalsIgnoreCase("true")) {
list.add(new RequiredHandler("architecture", null));
}
// The auto-attached handler list is ignored for handlers to avoid loops.
return list;
}
代码示例来源:origin: apache/felix
/**
* Compute required handlers.
* @return the list of required handler.
*/
public List<RequiredHandler> getRequiredHandlerList() {
List<RequiredHandler> list = new ArrayList<RequiredHandler>();
Element[] elems = m_componentMetadata.getElements();
for (Element current : elems) {
RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
}
}
// Add architecture if architecture != 'false'
String arch = m_componentMetadata.getAttribute("architecture");
if (arch == null || arch.equalsIgnoreCase("true")) {
RequiredHandler req = new RequiredHandler("architecture", null);
if (! list.contains(req)) { list.add(req); }
}
return list;
}
代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo.composite
/**
* Compute required handlers.
* @return the list of required handler.
*/
public List<RequiredHandler> getRequiredHandlerList() {
List<RequiredHandler> list = new ArrayList<RequiredHandler>();
Element[] elems = m_componentMetadata.getElements();
for (Element current : elems) {
RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
}
}
// Add architecture if architecture != 'false'
String arch = m_componentMetadata.getAttribute("architecture");
if (arch == null || arch.equalsIgnoreCase("true")) {
RequiredHandler req = new RequiredHandler("architecture", null);
if (! list.contains(req)) { list.add(req); }
}
return list;
}
代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo
/**
* Computes required handlers. This method does not manipulate any
* non-immutable fields, so does not need to be synchronized.
* This method is overridden to avoid using the same detection rules
* than 'primitive' components. Indeed, architecture is disable by default,
* and a handler is never immediate.
* @return the required handler list.
*/
public List<RequiredHandler> getRequiredHandlerList() {
List<RequiredHandler> list = new ArrayList<RequiredHandler>();
Element[] elems = m_componentMetadata.getElements();
for (int i = 0; i < elems.length; i++) {
Element current = elems[i];
if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
RequiredHandler req = new RequiredHandler(current.getName(),
current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
}
}
}
// Unlike normal components, the architecture is enable only when
// specified.
String arch = m_componentMetadata.getAttribute("architecture");
if (arch != null && arch.equalsIgnoreCase("true")) {
list.add(new RequiredHandler("architecture", null));
}
// The auto-attached handler list is ignored for handlers to avoid loops.
return list;
}
代码示例来源:origin: apache/felix
public HandlerBindingBuilder(final List<Binding> bindings, final Class<? extends Annotation> annotationType) {
m_binding = new Binding();
Type type = Type.getType(annotationType);
m_binding.setAnnotationType(type);
m_binding.setPredicate(onlySupportedElements(annotationType));
Element e = Elements.buildElement(type);
m_binding.setFactory(new GenericVisitorFactory(e.getName(), e.getNameSpace()));
bindings.add(m_binding);
}
代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo
Element[] elems = m_componentMetadata.getElements();
for (Element current : elems) {
if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
代码示例来源:origin: apache/felix
Element[] elems = m_componentMetadata.getElements();
for (Element current : elems) {
if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
if (!list.contains(req)) {
list.add(req);
代码示例来源:origin: apache/felix
binding.setPredicate(alwaysTrue());
final Element element = buildElement(handlerBindingDiscovery, type);
binding.setFactory(new GenericVisitorFactory(element.getName(), element.getNameSpace()));
内容来源于网络,如有侵权,请联系作者删除!