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

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

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

Element.<init>介绍

[英]Creates an Element.
[中]

代码示例

代码示例来源:origin: org.wisdom-framework/wisdom-ipojo-module

  1. /**
  2. * @return the Component element.
  3. */
  4. public static Element getComponentElement() {
  5. return new Element(COMPONENT, "");
  6. }
  7. }

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

  1. /**
  2. * Build an {@link Element} using the provided namespace and local name.
  3. */
  4. public static Element buildElement(final String namespace, final String name) {
  5. return new Element(name, namespace);
  6. }

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

  1. private static Element transformElement(org.w3c.dom.Element xmlElement) {
  2. return new Element(xmlElement.getLocalName(), xmlElement.getNamespaceURI());
  3. }

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

  1. /**
  2. * Gets the component type description (Element-Attribute form).
  3. * @return the component type description.
  4. * @see org.apache.felix.ipojo.Factory#getDescription()
  5. */
  6. public Element getDescription() {
  7. // Can be null, if not already computed.
  8. if (m_componentDesc == null) {
  9. return new Element("No description available for " + m_factoryName, "");
  10. }
  11. return m_componentDesc.getDescription();
  12. }

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

  1. /**
  2. * Gets the component type description (Element-Attribute form).
  3. * @return the component type description.
  4. * @see org.apache.felix.ipojo.Factory#getDescription()
  5. */
  6. public Element getDescription() {
  7. // Can be null, if not already computed.
  8. if (m_componentDesc == null) {
  9. return new Element("No description available for " + m_factoryName, "");
  10. }
  11. return m_componentDesc.getDescription();
  12. }

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

  1. /**
  2. * Looks for the <code>iPOJO-Components</code> header
  3. * in the given dictionary. Then, initializes the
  4. * {@link ManifestMetadataParser#m_elements} list (adds the
  5. * <code>iPOJO</code> root element) and parses the contained
  6. * component type declarations and instance configurations.
  7. * @param dict the given headers of the manifest file
  8. * @throws ParseException if any error occurs
  9. */
  10. public void parse(Dictionary dict) throws ParseException {
  11. String componentClassesStr = (String) dict.get("iPOJO-Components");
  12. // Add the ipojo element inside the element list
  13. addElement(new Element("iPOJO", ""));
  14. parseElements(componentClassesStr.trim());
  15. }

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

  1. /**
  2. * Looks for the <code>iPOJO-Components</code> header
  3. * in the given dictionary. Then, initializes the
  4. * {@link ManifestMetadataParser#m_elements} list (adds the
  5. * <code>iPOJO</code> root element) and parses the contained
  6. * component type declarations and instance configurations.
  7. * @param dict the given headers of the manifest file
  8. * @throws ParseException if any error occurs
  9. */
  10. public void parse(Dictionary dict) throws ParseException {
  11. String componentClassesStr = (String) dict.get("iPOJO-Components");
  12. // Add the ipojo element inside the element list
  13. addElement(new Element("iPOJO", ""));
  14. parseElements(componentClassesStr.trim());
  15. }

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

  1. /**
  2. * Parses the given header, initialized the
  3. * {@link ManifestMetadataParser#m_elements} list
  4. * (adds the <code>iPOJO</code> element) and parses
  5. * contained component type declarations and instance configurations.
  6. * @param header the given header of the manifest file
  7. * @throws ParseException if any error occurs
  8. */
  9. public void parseHeader(String header) throws ParseException {
  10. // Add the ipojo element inside the element list
  11. addElement(new Element("iPOJO", ""));
  12. parseElements(header.trim());
  13. }

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

  1. /**
  2. * Parses the given header, initialized the
  3. * {@link ManifestMetadataParser#m_elements} list
  4. * (adds the <code>iPOJO</code> element) and parses
  5. * contained component type declarations and instance configurations.
  6. * @param header the given header of the manifest file
  7. * @throws ParseException if any error occurs
  8. */
  9. public void parseHeader(String header) throws ParseException {
  10. // Add the ipojo element inside the element list
  11. addElement(new Element("iPOJO", ""));
  12. parseElements(header.trim());
  13. }

代码示例来源:origin: org.wisdom-framework/wisdom-ipojo-module

  1. /**
  2. * Declares an instance.
  3. *
  4. * @param workbench the workbench
  5. * @return the Instance element
  6. */
  7. public static Element declareInstance(ComponentWorkbench workbench) {
  8. Element instance = new Element("instance", "");
  9. instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()));
  10. return instance;
  11. }

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

  1. /**
  2. * Visit @Handler annotation attributes.
  3. * @see org.objectweb.asm.AnnotationVisitor#visit(String, Object)
  4. */
  5. public void visitEnd() {
  6. Element controller = new Element("controller", "");
  7. controller.addAttribute(new Attribute("field", field));
  8. workbench.getElements().put(controller, null);
  9. }
  10. }

代码示例来源:origin: org.wisdom-framework/wisdom-ipojo-module

  1. /**
  2. * Gets the 'provides' element.
  3. *
  4. * @return the provides element
  5. */
  6. public static Element getProvidesElement(String specifications) {
  7. Element provides = new Element("provides", "");
  8. if (specifications == null) {
  9. return provides;
  10. } else {
  11. Attribute attribute = new Attribute("specifications", specifications);
  12. provides.addAttribute(attribute);
  13. return provides;
  14. }
  15. }

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

  1. /**
  2. * Gets the instance description in the Element-Attribute form.
  3. * @return the root Element of the instance description
  4. * @see org.apache.felix.ipojo.api.HandlerConfiguration#getElement()
  5. */
  6. public Element getElement() {
  7. ensureValidity();
  8. Element instance = new Element("instance", "");
  9. instance.addAttribute(new Attribute("component", m_type));
  10. for (int i = 0; i < m_conf.size(); i++) {
  11. Element elem = (Element) m_conf.get(i);
  12. instance.addElement(elem);
  13. }
  14. return instance;
  15. }
  16. }

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

  1. /**
  2. * Adds a string property.
  3. * @param name the property name
  4. * @param value the property value
  5. * @return the current instantiated sub-service
  6. */
  7. public InstantiatedService addProperty(String name, String value) {
  8. Element elem = new Element("property", "");
  9. m_conf.add(elem);
  10. elem.addAttribute(new Attribute("name", name));
  11. elem.addAttribute(new Attribute("value", value));
  12. return this;
  13. }

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

  1. /**
  2. * Adds the string property.
  3. * @param name property name
  4. * @param value property value
  5. * @return the current instance
  6. */
  7. public Instance addProperty(String name, String value) {
  8. Element elem = new Element("property", "");
  9. m_conf.add(elem);
  10. elem.addAttribute(new Attribute("name", name));
  11. elem.addAttribute(new Attribute("value", value));
  12. return this;
  13. }

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

  1. /**
  2. * Sets the delegation policy of the given method.
  3. * @param method the method name
  4. * @param policy the delegation policy
  5. * @return the current exported service.
  6. */
  7. public ProvidedService setDelegation(String method, String policy) {
  8. Element element = new Element("delegation", "");
  9. element.addAttribute(new Attribute("method", method));
  10. element.addAttribute(new Attribute("policy", policy));
  11. m_delegation.add(element);
  12. return this;
  13. }

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

  1. @Override
  2. public void visitEnd() {
  3. Element cb = new Element("callback", "");
  4. cb.addAttribute(new Attribute("transition", transition.name().toLowerCase()));
  5. cb.addAttribute(new Attribute("method", name));
  6. workbench.getElements().put(cb, null);
  7. }
  8. }

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

  1. /**
  2. * Gets the provided element.
  3. * @return the 'provides' element describing
  4. * the current provided service.
  5. */
  6. public Element getElement() {
  7. ensureValidity();
  8. Element dep = new Element("provides", "");
  9. dep.addAttribute(new Attribute("action", "implement"));
  10. dep.addAttribute(new Attribute("specification", m_specification));
  11. for (int i = 0; i < m_delegation.size(); i++) {
  12. dep.addElement((Element) m_delegation.get(i));
  13. }
  14. return dep;
  15. }

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

  1. /**
  2. * Gets handler information.
  3. * This represent the actual state of the handler.
  4. * @return the handler information.
  5. */
  6. public Element getHandlerInfo() {
  7. Element elem = new Element("Handler", "");
  8. elem.addAttribute(new Attribute("name", m_handlerName));
  9. if (isValid()) {
  10. elem.addAttribute(new Attribute("state", "valid"));
  11. } else {
  12. elem.addAttribute(new Attribute("state", "invalid"));
  13. }
  14. return elem;
  15. }

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

  1. /**
  2. * Gets handler information.
  3. * This represent the actual state of the handler.
  4. * @return the handler information.
  5. */
  6. public Element getHandlerInfo() {
  7. Element elem = new Element("Handler", "");
  8. elem.addAttribute(new Attribute("name", m_handlerName));
  9. if (isValid()) {
  10. elem.addAttribute(new Attribute("state", "valid"));
  11. } else {
  12. elem.addAttribute(new Attribute("state", "invalid"));
  13. }
  14. return elem;
  15. }

相关文章