本文整理了Java中org.apache.felix.ipojo.metadata.Element.getNameSpace()
方法的一些代码示例,展示了Element.getNameSpace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getNameSpace()
方法的具体详情如下:
包路径:org.apache.felix.ipojo.metadata.Element
类名称:Element
方法名:getNameSpace
[英]Gets element namespace.
[中]获取元素命名空间。
代码示例来源: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: 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 String initExtension() {
if (m_componentMetadata.getNameSpace() == null) {
return m_componentMetadata.getName();
}
return m_componentMetadata.getNameSpace() + ":" + m_componentMetadata.getName();
}
代码示例来源:origin: apache/felix
/**
* End of the visit.
* All attribute were visited, we can update collectors data.
* @see org.objectweb.asm.commons.EmptyVisitor#visitEnd()
*/
public void visitEnd() {
if (m_id != null) {
// An ID has been provided as annotation attribute
// Register our element under that ID
workbench.getIds().put(m_id, element);
} else {
// No ID provided, generate a new one from the element's namespace (aka handler's namespace)
m_id = element.getNameSpace();
if (m_id != null && !workbench.getIds().containsKey(m_id) && isClassType()) {
// No Elements were already registered under that namespace
workbench.getIds().put(m_id, element);
} else {
// ID already registered by another annotation
if (m_parent == null) {
// If no parent specified, place this element under the 'class level' Element (default)
m_parent = element.getNameSpace();
} // Otherwise, place this element under the specified Element (contribution)
}
}
workbench.getElements().put(element, m_parent);
}
代码示例来源: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: 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: 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
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
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()));
内容来源于网络,如有侵权,请联系作者删除!