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

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

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

Dom.attributesToWrite介绍

[英]Returns the map of attributes names and values for attributes which value is neither null or the default value. These attributes are considered having a non default value and must be written out.
[中]返回属性名称和值的映射,这些属性的值既不是null也不是默认值。这些属性被视为具有非默认值,必须写出。

代码示例

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

/**
 * Returns true if this element is empty
 * meaning all their attributes have default values and it has
 * no descendants.
 *
 * @return true if the element is empty, false otherwise
 */
private boolean isEmpty() {
  Map<String, String> attributesToWrite = attributesToWrite();
  if (!attributesToWrite.isEmpty()) {
    return false;
  }
  // if we have children, we are not empty.
  return children.isEmpty();
}

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

for (Map.Entry<String, String> attributeToWrite : attributesToWrite().entrySet()) {
  w.writeAttribute(attributeToWrite.getKey(), attributeToWrite.getValue());

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

/**
 * Returns true if this element is empty
 * meaning all their attributes have default values and it has
 * no descendants.
 *
 * @return true if the element is empty, false otherwise
 */
private boolean isEmpty() {
  Map<String, String> attributesToWrite = attributesToWrite();
  if (!attributesToWrite.isEmpty()) {
    return false;
  }
  // if we have children, we are not empty.
  return children.isEmpty();
}

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

/**
 * Returns true if this element is empty
 * meaning all their attributes have default values and it has
 * no descendants.
 *
 * @return true if the element is empty, false otherwise
 */
private boolean isEmpty() {
  Map<String, String> attributesToWrite = attributesToWrite();
  if (!attributesToWrite.isEmpty()) {
    return false;
  }
  // if we have children, we are not empty.
  return children.isEmpty();
}

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

/**
 * Returns true if this element is empty
 * meaning all their attributes have default values and it has
 * no descendants.
 *
 * @return true if the element is empty, false otherwise
 */
private boolean isEmpty() {
  Map<String, String> attributesToWrite = attributesToWrite();
  if (!attributesToWrite.isEmpty()) {
    return false;
  }
  // if we have children, we are not empty.
  return children.isEmpty();
}

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

/**
 * Returns true if this element is empty
 * meaning all their attributes have default values and it has
 * no descendants.
 *
 * @return true if the element is empty, false otherwise
 */
private boolean isEmpty() {
  Map<String, String> attributesToWrite = attributesToWrite();
  if (!attributesToWrite.isEmpty()) {
    return false;
  }
  // if we have children, we are not empty.
  return children.isEmpty();
}

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

/**
 * Writes back this element.
 *
 * @param tagName
 *      The tag name of this element to be written. If null, this DOM node
 *      must be a global element and its tag name will be used.
 * @param w
 *      Receives XML infoset stream.
 */
public void writeTo(String tagName, XMLStreamWriter w) throws XMLStreamException {
  if(tagName==null)
    tagName = model.tagName;
  if(tagName==null)
    throw new IllegalArgumentException("Trying t write a local element "+this+" w/o a tag name");
  w.writeStartElement(tagName);
  
  for (Map.Entry<String, String> attributeToWrite : attributesToWrite().entrySet()) {
    w.writeAttribute(attributeToWrite.getKey(), attributeToWrite.getValue());
  }
  List<Child> localChildren = new ArrayList<Child>(children);
  for (Child c : localChildren)
    c.writeTo(w);
  w.writeEndElement();
}

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

/**
 * Writes back this element.
 *
 * @param tagName
 *      The tag name of this element to be written. If null, this DOM node
 *      must be a global element and its tag name will be used.
 * @param w
 *      Receives XML infoset stream.
 */
public void writeTo(String tagName, XMLStreamWriter w) throws XMLStreamException {
  if(tagName==null)
    tagName = model.tagName;
  if(tagName==null)
    throw new IllegalArgumentException("Trying t write a local element "+this+" w/o a tag name");
  w.writeStartElement(tagName);
  
  for (Map.Entry<String, String> attributeToWrite : attributesToWrite().entrySet()) {
    w.writeAttribute(attributeToWrite.getKey(), attributeToWrite.getValue());
  }
  List<Child> localChildren = new ArrayList<Child>(children);
  for (Child c : localChildren)
    c.writeTo(w);
  w.writeEndElement();
}

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

for (Map.Entry<String, String> attributeToWrite : attributesToWrite().entrySet()) {
  w.writeAttribute(attributeToWrite.getKey(), attributeToWrite.getValue());

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

for (Map.Entry<String, String> attributeToWrite : attributesToWrite().entrySet()) {
  w.writeAttribute(attributeToWrite.getKey(), attributeToWrite.getValue());

相关文章

微信公众号

最新文章

更多