org.jdom.Attribute.setNamespace()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(64)

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

Attribute.setNamespace介绍

[英]This sets this Attribute's Namespace. If the provided namespace is null, the attribute will have no namespace. The namespace must have a prefix.
[中]这将设置此AttributeNamespace。如果提供的名称空间为null,则该属性将没有名称空间。命名空间必须具有前缀。

代码示例

代码示例来源:origin: org.jdom/jdom-legacy

/**
 * This will create a new <code>Attribute</code> with the
 * specified (local) name, value, and type, and in the provided
 * <code>{@link Namespace}</code>.
 *
 * @param name <code>String</code> name of <code>Attribute</code>.
 * @param value <code>String</code> value for new attribute.
 * @param type <code>int</code> type for new attribute.
 * @param namespace <code>Namespace</code> namespace for new attribute.
 * @throws IllegalNameException if the given name is illegal as an
 *         attribute name or if if the new namespace is the default
 *         namespace. Attributes cannot be in a default namespace.
 * @throws IllegalDataException if the given attribute value is
 *         illegal character data (as determined by
 *         {@link org.jdom.Verifier#checkCharacterData}) or
 *         if the given attribute type is not one of the
 *         supported types.
 */
public Attribute(final String name, final String value, final int type, final Namespace namespace) {
  setName(name);
  setValue(value);
  setAttributeType(type);
  setNamespace(namespace);
}

代码示例来源:origin: org.biomoby/taverna-biomoby

"namespace", "id" }) {
if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {
  if (element.getAttribute(attr) != null)
  element.getAttribute(attr).setNamespace(mobyNS);
  "namespace", "id" }) {

相关文章