com.vladsch.flexmark.util.html.Attributes.keySet()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(203)

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

Attributes.keySet介绍

暂无

代码示例

代码示例来源:origin: vsch/flexmark-java

@Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    String sep = "";
    for (String attrName : keySet()) {
      sb.append(sep).append(attrName);
      Attribute attribute = myAttributes.get(attrName);
      if (!attribute.getValue().isEmpty()) sb.append("=").append("\"").append(attribute.getValue().replace("\"", "\\\"")).append("\"");
      sep = " ";
    }
    return "Attributes{" +
        "myAttributes=" + sb.toString() +
        '}';
  }
}

代码示例来源:origin: vsch/flexmark-java

private void transferToParentOnly(String... includes) {
  if (myStateStack.isEmpty())
    throw new IllegalStateException("transferIdToParent with an empty stack");
  final Attributes attributes = new Attributes();
  for (String include : includes) {
    Attribute attribute = myState.myAttributes.get(include);
    if (attribute != null) {
      myState.myAttributes.remove(include);
      attributes.addValue(attribute);
    }
  }
  if (!attributes.isEmpty()) {
    final State parentState = myStateStack.peek();
    for (String attrName : attributes.keySet()) {
      parentState.myAttributes.addValue(attributes.get(attrName));
    }
  }
}

代码示例来源:origin: vsch/flexmark-java

private void transferToParentExcept(String... excludes) {
  if (myStateStack.isEmpty())
    throw new IllegalStateException("transferIdToParent with an empty stack");
  final Attributes attributes = new Attributes(myState.myAttributes);
  myState.myAttributes.clear();
  for (String exclude : excludes) {
    myState.myAttributes.addValue(attributes.get(exclude));
    attributes.remove(exclude);
  }
  if (!attributes.isEmpty()) {
    final State parentState = myStateStack.peek();
    for (String attrName : attributes.keySet()) {
      parentState.myAttributes.addValue(attributes.get(attrName));
    }
  }
}

代码示例来源:origin: vsch/flexmark-java

out.append("{");
for (String attrName : attributes.keySet()) {
  String value = attributes.getValue(attrName);
  out.append(sep);

代码示例来源:origin: com.vladsch.flexmark/flexmark-util

@Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    String sep = "";
    for (String attrName : keySet()) {
      sb.append(sep).append(attrName);
      Attribute attribute = myAttributes.get(attrName);
      if (!attribute.getValue().isEmpty()) sb.append("=").append("\"").append(attribute.getValue().replace("\"", "\\\"")).append("\"");
      sep = " ";
    }
    return "Attributes{" +
        "myAttributes=" + sb.toString() +
        '}';
  }
}

相关文章