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

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

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

Element.getName介绍

[英]Gets element name.
[中]获取元素名称。

代码示例

代码示例来源: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 boolean isInstance(Element element) {
  2. return "instance".equals(element.getName());
  3. }
  4. }

代码示例来源: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: org.apache.felix/org.apache.felix.ipojo

  1. /**
  2. * Gets the array of component type metadata.
  3. * @return the component metadata (composite & component).
  4. * An empty array is returned if no component type declaration.
  5. * @throws ParseException if a parsing error occurs
  6. */
  7. public Element[] getComponentsMetadata() throws ParseException {
  8. Element[] elems = m_elements[0].getElements();
  9. List list = new ArrayList();
  10. for (int i = 0; i < elems.length; i++) {
  11. if (!"instance".equals(elems[i].getName())) {
  12. list.add(elems[i]);
  13. }
  14. }
  15. return (Element[]) list.toArray(new Element[list.size()]);
  16. }

代码示例来源: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: apache/felix

  1. /**
  2. * Gets the array of component type metadata.
  3. * @return the component metadata (composite & component).
  4. * An empty array is returned if no component type declaration.
  5. * @throws ParseException if a parsing error occurs
  6. */
  7. public Element[] getComponentsMetadata() throws ParseException {
  8. Element[] elems = m_elements[0].getElements();
  9. List list = new ArrayList();
  10. for (int i = 0; i < elems.length; i++) {
  11. if (!"instance".equals(elems[i].getName())) {
  12. list.add(elems[i]);
  13. }
  14. }
  15. return (Element[]) list.toArray(new Element[list.size()]);
  16. }

代码示例来源: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: 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: 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. Element[] elems = m_componentMetadata.getElements();
  2. for (Element current : elems) {
  3. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  4. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  5. if (!list.contains(req)) {
  6. list.add(req);

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

  1. Element[] elems = m_componentMetadata.getElements();
  2. for (Element current : elems) {
  3. if (!"manipulation".equals(current.getName())) { // Remove the manipulation element
  4. RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
  5. if (!list.contains(req)) {
  6. 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()));

相关文章