org.jvnet.hk2.config.Dom.leafElement()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(160)

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

Dom.leafElement介绍

[英]Picks up one leaf-element value.
[中]拾取一个叶元素值。

代码示例

代码示例来源:origin: javaee/glassfish

public void element_setText(Dom dom, GadgetModule target) {
  String v1 = dom.leafElement("Content");
  if (v1 == null) {
    return ;
  }
  target.setText(v1);
}

代码示例来源:origin: javaee/glassfish

/**
 * Obtains the actual key value from this {@link Dom}.
 */
public String getKey() {
  String k = model.key;
  if(k==null) return null;
  switch(k.charAt(0)) {
  case '@':
    return attribute(k.substring(1));
  case '<':
    return leafElement(k.substring(1,k.length()-1));
  default:
    throw new IllegalStateException("Invalid key value:"+k);
  }
}

代码示例来源:origin: javaee/glassfish

public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,arg.toString());
    }
  }
}

代码示例来源:origin: javaee/glassfish

public Object get(Dom dom, Type returnType) {
  // leaf types
  String v = dom.leafElement(xmlName);
  return convertLeafValue(dom, Types.erasure(returnType), v);
}

代码示例来源:origin: javaee/glassfish

@Override
public Object get(Dom dom, Type returnType) {
  String id = dom.leafElement(xmlName);
  Class<?> type = Types.erasure(returnType);
  // let's look first the fast way.
  Object candidate = dom.getHabitat().getService(type, id);
  if (candidate!=null) {
    return type.cast(candidate);
  }
  dom = dom.getSymbolSpaceRoot(id);
  return type.cast(dom.resolveReference(id,type.getName()).get());
}

代码示例来源:origin: javaee/glassfish

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/config

public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,arg.toString());
    }
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,arg.toString());
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,arg.toString());
    }
  }
}

代码示例来源:origin: com.sun.enterprise/config

public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,arg.toString());
    }
  }
}

代码示例来源:origin: com.sun.enterprise/config

public Object get(Dom dom, Type returnType) {
  // leaf types
  String v = dom.leafElement(xmlName);
  return convertLeafValue(Types.erasure(returnType), v);
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

public Object get(Dom dom, Type returnType) {
  // leaf types
  String v = dom.leafElement(xmlName);
  return convertLeafValue(dom, Types.erasure(returnType), v);
}

代码示例来源:origin: eclipse-ee4j/glassfish

public Object get(Dom dom, Type returnType) {
  // leaf types
  String v = dom.leafElement(xmlName);
  return convertLeafValue(dom, Types.erasure(returnType), v);
}

代码示例来源:origin: org.glassfish.hk2/config

public Object get(Dom dom, Type returnType) {
  // leaf types
  String v = dom.leafElement(xmlName);
  return convertLeafValue(dom, Types.erasure(returnType), v);
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
public Object get(Dom dom, Type returnType) {
  String id = dom.leafElement(xmlName);
  Class<?> type = Types.erasure(returnType);
  // let's look first the fast way.
  Object candidate = dom.getHabitat().getService(type, id);
  if (candidate!=null) {
    return type.cast(candidate);
  }
  dom = dom.getSymbolSpaceRoot(id);
  return type.cast(dom.resolveReference(id,type.getName()).get());
}

代码示例来源:origin: org.glassfish.hk2/config

@Override
public Object get(Dom dom, Type returnType) {
  String id = dom.leafElement(xmlName);
  Class<?> type = Types.erasure(returnType);
  // let's look first the fast way.
  Object candidate = dom.getHabitat().getComponent(type, id);
  if (candidate!=null) {
    return type.cast(candidate);
  }
  dom = dom.getSymbolSpaceRoot(id);
  return type.cast(dom.resolveReference(id,type.getName()).get());
}

代码示例来源:origin: org.glassfish.hk2/config

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

代码示例来源:origin: com.sun.enterprise/config

@Override
public Object get(Dom dom, Type returnType) {
  String id = dom.leafElement(xmlName);
  Class<?> type = Types.erasure(returnType);
  // let's look first the fast way.
  Object candidate = dom.getHabitat().getComponent(type, id);
  if (candidate!=null) {
    return type.cast(candidate);
  }
  dom = dom.getSymbolSpaceRoot(id);
  return type.cast(dom.resolveReference(id,type.getName()).get());
}

代码示例来源:origin: com.sun.enterprise/config

@Override
  public void set(Dom dom, Object arg) {
    if(arg==null) {
      dom.removeLeafElement(xmlName, dom.leafElement(xmlName));
    } else {
      dom.setLeafElements(xmlName,((Dom) arg).getKey());
    }
  }
}

相关文章