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

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

本文整理了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

/**
   * @return the Component element.
   */
  public static Element getComponentElement() {
    return new Element(COMPONENT, "");
  }
}

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

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

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

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

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

/**
 * Gets the component type description (Element-Attribute form).
 * @return the component type description.
 * @see org.apache.felix.ipojo.Factory#getDescription()
 */
public Element getDescription() {
  // Can be null, if not already computed.
  if (m_componentDesc == null) {
    return new Element("No description available for " + m_factoryName, "");
  }
  return m_componentDesc.getDescription();
}

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

/**
 * Gets the component type description (Element-Attribute form).
 * @return the component type description.
 * @see org.apache.felix.ipojo.Factory#getDescription()
 */
public Element getDescription() {
  // Can be null, if not already computed.
  if (m_componentDesc == null) {
    return new Element("No description available for " + m_factoryName, "");
  }
  return m_componentDesc.getDescription();
}

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

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

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

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

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

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

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

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

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

/**
 * Declares an instance.
 *
 * @param workbench the workbench
 * @return the Instance element
 */
public static Element declareInstance(ComponentWorkbench workbench) {
  Element instance = new Element("instance", "");
  instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()));
  return instance;
}

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

/**
   * Visit @Handler annotation attributes.
   * @see org.objectweb.asm.AnnotationVisitor#visit(String, Object)
   */
  public void visitEnd() {
    Element controller = new Element("controller", "");
    controller.addAttribute(new Attribute("field", field));
    workbench.getElements().put(controller, null);
  }
}

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

/**
 * Gets the 'provides' element.
 *
 * @return the provides element
 */
public static Element getProvidesElement(String specifications) {
  Element provides = new Element("provides", "");
  if (specifications == null) {
    return provides;
  } else {
    Attribute attribute = new Attribute("specifications", specifications);
    provides.addAttribute(attribute);
    return provides;
  }
}

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

/**
   * Gets the instance description in the Element-Attribute form.
   * @return the root Element of the instance description 
   * @see org.apache.felix.ipojo.api.HandlerConfiguration#getElement()
   */
  public Element getElement() {
    ensureValidity();
    Element instance = new Element("instance", "");
    instance.addAttribute(new Attribute("component", m_type));
    for (int i = 0; i < m_conf.size(); i++) {
      Element elem = (Element) m_conf.get(i);
      instance.addElement(elem);
    }
    return instance;
  }
}

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

/**
 * Adds a string property.
 * @param name the property name
 * @param value the property value
 * @return the current instantiated sub-service
 */
public InstantiatedService addProperty(String name, String value) {
  Element elem = new Element("property", "");
  m_conf.add(elem);
  elem.addAttribute(new Attribute("name", name));
  elem.addAttribute(new Attribute("value", value));
  return this;
}

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

/**
 * Adds the string property.
 * @param name property name
 * @param value property value
 * @return the current instance
 */
public Instance addProperty(String name, String value) {
  Element elem = new Element("property", "");
  m_conf.add(elem);
  elem.addAttribute(new Attribute("name", name));
  elem.addAttribute(new Attribute("value", value));
  return this;
}

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

/**
 * Sets the delegation policy of the given method.
 * @param method  the method name
 * @param policy the delegation policy
 * @return the current exported service.
 */
public ProvidedService setDelegation(String method, String policy) {
  Element element = new Element("delegation", "");
  element.addAttribute(new Attribute("method", method));
  element.addAttribute(new Attribute("policy", policy));
  m_delegation.add(element);
  return this;
}

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

@Override
  public void visitEnd() {
    Element cb = new Element("callback", "");
    cb.addAttribute(new Attribute("transition", transition.name().toLowerCase()));
    cb.addAttribute(new Attribute("method", name));
    workbench.getElements().put(cb, null);
  }
}

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

/**
 * Gets the provided element.
 * @return the 'provides' element describing
 * the current provided service.
 */
public Element getElement() {
  ensureValidity();
  
  Element dep = new Element("provides", "");
  dep.addAttribute(new Attribute("action", "implement"));
    dep.addAttribute(new Attribute("specification", m_specification));
  for (int i = 0; i < m_delegation.size(); i++) {
    dep.addElement((Element) m_delegation.get(i));
  }
  
  return dep;
}

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

/**
 * Gets handler information.
 * This represent the actual state of the handler.
 * @return the handler information.
 */
public Element getHandlerInfo() {
  Element elem = new Element("Handler", "");
  elem.addAttribute(new Attribute("name", m_handlerName));
  if (isValid()) {
    elem.addAttribute(new Attribute("state", "valid"));
  } else {
    elem.addAttribute(new Attribute("state", "invalid"));
  }
  return elem;
}

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

/**
 * Gets handler information.
 * This represent the actual state of the handler.
 * @return the handler information.
 */
public Element getHandlerInfo() {
  Element elem = new Element("Handler", "");
  elem.addAttribute(new Attribute("name", m_handlerName));
  if (isValid()) {
    elem.addAttribute(new Attribute("state", "valid"));
  } else {
    elem.addAttribute(new Attribute("state", "invalid"));
  }
  return elem;
}

相关文章