org.apache.felix.ipojo.metadata.Element.getNameSpace()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(619)

本文整理了Java中org.apache.felix.ipojo.metadata.Element.getNameSpace()方法的一些代码示例,展示了Element.getNameSpace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getNameSpace()方法的具体详情如下:
包路径:org.apache.felix.ipojo.metadata.Element
类名称:Element
方法名:getNameSpace

Element.getNameSpace介绍

[英]Gets element namespace.
[中]获取元素命名空间。

代码示例

代码示例来源:origin: apache/felix

  1. private void startElement(Element element, StringBuilder builder) {
  2. // Default namespace is empty
  3. String namespace = "";
  4. if (element.getNameSpace() != null) {
  5. namespace = element.getNameSpace() + ":";
  6. }
  7. builder.append(namespace)
  8. .append(element.getName())
  9. .append(" { ");
  10. }

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo

  1. private String initExtension() {
  2. if (m_componentMetadata.getNameSpace() == null) {
  3. return m_componentMetadata.getName();
  4. }
  5. return m_componentMetadata.getNameSpace() + ":" + m_componentMetadata.getName();
  6. }

代码示例来源:origin: apache/felix

  1. private String initExtension() {
  2. if (m_componentMetadata.getNameSpace() == null) {
  3. return m_componentMetadata.getName();
  4. }
  5. return m_componentMetadata.getNameSpace() + ":" + m_componentMetadata.getName();
  6. }

代码示例来源:origin: apache/felix

  1. /**
  2. * End of the visit.
  3. * All attribute were visited, we can update collectors data.
  4. * @see org.objectweb.asm.commons.EmptyVisitor#visitEnd()
  5. */
  6. public void visitEnd() {
  7. if (m_id != null) {
  8. // An ID has been provided as annotation attribute
  9. // Register our element under that ID
  10. workbench.getIds().put(m_id, element);
  11. } else {
  12. // No ID provided, generate a new one from the element's namespace (aka handler's namespace)
  13. m_id = element.getNameSpace();
  14. if (m_id != null && !workbench.getIds().containsKey(m_id) && isClassType()) {
  15. // No Elements were already registered under that namespace
  16. workbench.getIds().put(m_id, element);
  17. } else {
  18. // ID already registered by another annotation
  19. if (m_parent == null) {
  20. // If no parent specified, place this element under the 'class level' Element (default)
  21. m_parent = element.getNameSpace();
  22. } // Otherwise, place this element under the specified Element (contribution)
  23. }
  24. }
  25. workbench.getElements().put(element, m_parent);
  26. }

代码示例来源:origin: apache/felix

  1. /**
  2. * Compute required handlers.
  3. * @return the list of required handler.
  4. */
  5. public List<RequiredHandler> getRequiredHandlerList() {
  6. List<RequiredHandler> list = new ArrayList<RequiredHandler>();
  7. Element[] elems = m_componentMetadata.getElements();
  8. for (Element current : elems) {
  9. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  10. if (!list.contains(req)) {
  11. list.add(req);
  12. }
  13. }
  14. // Add architecture if architecture != 'false'
  15. String arch = m_componentMetadata.getAttribute("architecture");
  16. if (arch == null || arch.equalsIgnoreCase("true")) {
  17. RequiredHandler req = new RequiredHandler("architecture", null);
  18. if (! list.contains(req)) { list.add(req); }
  19. }
  20. return list;
  21. }

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo.composite

  1. /**
  2. * Compute required handlers.
  3. * @return the list of required handler.
  4. */
  5. public List<RequiredHandler> getRequiredHandlerList() {
  6. List<RequiredHandler> list = new ArrayList<RequiredHandler>();
  7. Element[] elems = m_componentMetadata.getElements();
  8. for (Element current : elems) {
  9. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  10. if (!list.contains(req)) {
  11. list.add(req);
  12. }
  13. }
  14. // Add architecture if architecture != 'false'
  15. String arch = m_componentMetadata.getAttribute("architecture");
  16. if (arch == null || arch.equalsIgnoreCase("true")) {
  17. RequiredHandler req = new RequiredHandler("architecture", null);
  18. if (! list.contains(req)) { list.add(req); }
  19. }
  20. return list;
  21. }

代码示例来源:origin: apache/felix

  1. /**
  2. * Computes required handlers. This method does not manipulate any
  3. * non-immutable fields, so does not need to be synchronized.
  4. * This method is overridden to avoid using the same detection rules
  5. * than 'primitive' components. Indeed, architecture is disable by default,
  6. * and a handler is never immediate.
  7. * @return the required handler list.
  8. */
  9. public List<RequiredHandler> getRequiredHandlerList() {
  10. List<RequiredHandler> list = new ArrayList<RequiredHandler>();
  11. Element[] elems = m_componentMetadata.getElements();
  12. for (int i = 0; i < elems.length; i++) {
  13. Element current = elems[i];
  14. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  15. RequiredHandler req = new RequiredHandler(current.getName(),
  16. current.getNameSpace());
  17. if (!list.contains(req)) {
  18. list.add(req);
  19. }
  20. }
  21. }
  22. // Unlike normal components, the architecture is enable only when
  23. // specified.
  24. String arch = m_componentMetadata.getAttribute("architecture");
  25. if (arch != null && arch.equalsIgnoreCase("true")) {
  26. list.add(new RequiredHandler("architecture", null));
  27. }
  28. // The auto-attached handler list is ignored for handlers to avoid loops.
  29. return list;
  30. }

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo

  1. /**
  2. * Computes required handlers. This method does not manipulate any
  3. * non-immutable fields, so does not need to be synchronized.
  4. * This method is overridden to avoid using the same detection rules
  5. * than 'primitive' components. Indeed, architecture is disable by default,
  6. * and a handler is never immediate.
  7. * @return the required handler list.
  8. */
  9. public List<RequiredHandler> getRequiredHandlerList() {
  10. List<RequiredHandler> list = new ArrayList<RequiredHandler>();
  11. Element[] elems = m_componentMetadata.getElements();
  12. for (int i = 0; i < elems.length; i++) {
  13. Element current = elems[i];
  14. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  15. RequiredHandler req = new RequiredHandler(current.getName(),
  16. current.getNameSpace());
  17. if (!list.contains(req)) {
  18. list.add(req);
  19. }
  20. }
  21. }
  22. // Unlike normal components, the architecture is enable only when
  23. // specified.
  24. String arch = m_componentMetadata.getAttribute("architecture");
  25. if (arch != null && arch.equalsIgnoreCase("true")) {
  26. list.add(new RequiredHandler("architecture", null));
  27. }
  28. // The auto-attached handler list is ignored for handlers to avoid loops.
  29. return list;
  30. }

代码示例来源:origin: apache/felix

  1. public HandlerBindingBuilder(final List<Binding> bindings, final Class<? extends Annotation> annotationType) {
  2. m_binding = new Binding();
  3. Type type = Type.getType(annotationType);
  4. m_binding.setAnnotationType(type);
  5. m_binding.setPredicate(onlySupportedElements(annotationType));
  6. Element e = Elements.buildElement(type);
  7. m_binding.setFactory(new GenericVisitorFactory(e.getName(), e.getNameSpace()));
  8. bindings.add(m_binding);
  9. }

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo

  1. for (Element current : elems) {
  2. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  3. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  4. if (!list.contains(req)) {
  5. list.add(req);

代码示例来源:origin: apache/felix

  1. for (Element current : elems) {
  2. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  3. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  4. if (!list.contains(req)) {
  5. list.add(req);

代码示例来源:origin: apache/felix

  1. binding.setPredicate(alwaysTrue());
  2. final Element element = buildElement(handlerBindingDiscovery, type);
  3. binding.setFactory(new GenericVisitorFactory(element.getName(), element.getNameSpace()));

相关文章