org.yaml.snakeyaml.nodes.Tag.equals()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(79)

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

Tag.equals介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-shardingsphere

private boolean isNullNode(final Node valueNode) {
  return Tag.NULL.equals(valueNode.getTag());
}

代码示例来源:origin: apache/incubator-shardingsphere

private boolean isEmptyMappingNode(final Node valueNode) {
    return Tag.MAP.equals(valueNode.getTag()) && ((MappingNode) valueNode).getValue().isEmpty();
  }
}

代码示例来源:origin: apache/incubator-shardingsphere

private boolean isEmptySequenceNode(final Node valueNode) {
  return Tag.SEQ.equals(valueNode.getTag()) && ((SequenceNode) valueNode).getValue().isEmpty();
}

代码示例来源:origin: embulk/embulk

@Override
public void addImplicitResolver(Tag tag, Pattern regexp, String first) {
  // This method is called by constructor through addImplicitResolvers
  // to setup default implicit resolvers.
  if (tag.equals(Tag.FLOAT)) {
    super.addImplicitResolver(Tag.FLOAT, FLOAT_EXCEPTING_ZERO_START, "-+0123456789.");
  } else if (tag.equals(Tag.BOOL)) {
    // use stricter rule (reject 'On', 'Off', 'Yes', 'No')
    super.addImplicitResolver(Tag.BOOL, Pattern.compile("^(?:[Tt]rue|[Ff]alse)$"), "TtFf");
  } else if (tag.equals(Tag.TIMESTAMP)) {
    // This solves some unexpected behavior that snakeyaml
    // deserializes "2015-01-01 00:00:00" to java.util.Date
    // but jackson serializes java.util.Date to an integer.
    return;
  } else {
    super.addImplicitResolver(tag, regexp, first);
  }
}

代码示例来源:origin: redisson/redisson

public boolean useClassConstructor() {
  if (useClassConstructor == null) {
    if (!tag.isSecondary() && resolved && !Object.class.equals(type)
        && !tag.equals(Tag.NULL)) {
      return true;
    } else if (tag.isCompatible(getType())) {
      // the tag is compatible with the runtime class
      // the tag will be ignored
      return true;
    } else {
      return false;
    }
  }
  return useClassConstructor.booleanValue();
}

代码示例来源:origin: redisson/redisson

protected void composeMappingChildren(List<NodeTuple> children, MappingNode node) {
  Node itemKey = composeKeyNode(node);
  if (itemKey.getTag().equals(Tag.MERGE)) {
    node.setMerged(true);
  }
  Node itemValue = composeValueNode(node);
  children.add(new NodeTuple(itemKey, itemValue));
}

代码示例来源:origin: redisson/redisson

for (NodeTuple tuple : nodeValue) {
  Node keyNode = tuple.getKeyNode();
  if (!keyNode.getTag().equals(Tag.MERGE)) {
    Object key = constructObject(keyNode);
    if (key != null) {

代码示例来源:origin: redisson/redisson

|| type == Character.class || type == BigInteger.class
|| type == BigDecimal.class || Enum.class.isAssignableFrom(type)
|| Tag.BINARY.equals(node.getTag()) || Calendar.class.isAssignableFrom(type)
|| type == UUID.class) {

代码示例来源:origin: redisson/redisson

final Node keyNode = nodeTuple.getKeyNode();
final Node valueNode = nodeTuple.getValueNode();
if (keyNode.getTag().equals(Tag.MERGE)) {
  iter.remove();
  switch (valueNode.getNodeId()) {

代码示例来源:origin: redisson/redisson

/**
 * Ensure that the stream contains a single document and construct it
 *
 * @param type the class of the instance being created
 * @return constructed instance
 * @throws ComposerException in case there are more documents in the stream
 */
public Object getSingleData(Class<?> type) {
  // Ensure that the stream contains a single document and construct it
  Node node = composer.getSingleNode();
  if (node != null && !Tag.NULL.equals(node.getTag())) {
    if (Object.class != type) {
      node.setTag(new Tag(type));
    } else if (rootTag != null) {
      node.setTag(rootTag);
    }
    return constructDocument(node);
  }
  return null;
}

代码示例来源:origin: redisson/redisson

if (property.getType() == propertyValue.getClass()) {
  if (!(propertyValue instanceof Map<?, ?>)) {
    if (!nodeValue.getTag().equals(Tag.SET)) {
      nodeValue.setTag(Tag.MAP);

代码示例来源:origin: redisson/redisson

Tag detectedTag = this.resolver.resolve(NodeId.scalar, scalarNode.getValue(), true);
  Tag defaultTag = this.resolver.resolve(NodeId.scalar, scalarNode.getValue(), false);
  ImplicitTuple tuple = new ImplicitTuple(node.getTag().equals(detectedTag), node
      .getTag().equals(defaultTag));
  ScalarEvent event = new ScalarEvent(tAlias, node.getTag().getValue(), tuple,
      scalarNode.getValue(), null, null, scalarNode.getStyle());
case sequence:
  SequenceNode seqNode = (SequenceNode) node;
  boolean implicitS = node.getTag().equals(this.resolver.resolve(NodeId.sequence,
      null, true));
  this.emitter.emit(new SequenceStartEvent(tAlias, node.getTag().getValue(),
default:// instance of MappingNode
  Tag implicitTag = this.resolver.resolve(NodeId.mapping, null, true);
  boolean implicitM = node.getTag().equals(implicitTag);
  this.emitter.emit(new MappingStartEvent(tAlias, node.getTag().getValue(),
      implicitM, null, null, ((CollectionNode) node).getFlowStyle()));

代码示例来源:origin: redisson/redisson

if (property.getType() == String.class && Tag.BINARY.equals(valueNode.getTag())
    && value instanceof byte[]) {
  value = new String((byte[]) value);

代码示例来源:origin: org.raml/raml-parser

@Override
public boolean handles(Tag tag)
{
  return JAXB_TAG.equals(tag);
}

代码示例来源:origin: com.sap.cloud.yaas.raml-parser/raml-parser

@Override
public boolean handles(Tag tag)
{
  return JACKSON_TAG.equals(tag);
}

代码示例来源:origin: org.raml/raml-parser

@Override
public boolean handles(Tag tag)
{
  return INCLUDE_TAG.equals(tag) || tag.startsWith(INCLUDE_APPLIED_TAG);
}

代码示例来源:origin: com.sap.cloud.yaas.raml-parser/raml-parser

private Node resolveInclude(Node node)
{
  if (node.getNodeId() == scalar && node.getTag().equals(INCLUDE_TAG))
  {
    return includeResolver.resolve(node, resourceLoader, nodeNandler);
  }
  return node;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

protected void composeMappingChildren(List<NodeTuple> children, MappingNode node) {
  Node itemKey = composeKeyNode(node);
  if (itemKey.getTag().equals(Tag.MERGE)) {
    node.setMerged(true);
  }
  Node itemValue = composeValueNode(node);
  children.add(new NodeTuple(itemKey, itemValue));
}

代码示例来源:origin: org.onehippo.cms/hippo-configuration-management-model

protected String asStringScalar(final Node node) throws ParserException {
  final ScalarNode scalarNode = asScalar(node);
  if (!scalarNode.getTag().equals(Tag.STR)) {
    throw new ParserException("Scalar must be a string", node);
  }
  return scalarNode.getValue();
}

代码示例来源:origin: info.magnolia.core/magnolia-configuration

@Override
protected void constructMapping2ndStep(MappingNode node, Map<Object, Object> mapping) {
  List<NodeTuple> nodeValue = node.getValue();
  for (NodeTuple tuple : nodeValue) {
    if (Tag.INT.equals(tuple.getKeyNode().getTag())) {
      tuple.getKeyNode().setTag(Tag.STR);
    }
  }
  super.constructMapping2ndStep(node, mapping);
}

相关文章