ConstructorException
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.yaml.snakeyaml.constructor.ConstructorException (Showing top 20 results out of 315)

  • Common ways to obtain ConstructorException
private void myMethod () {
ConstructorException c =
  • String str;Node node;new ConstructorException(null, null, str, node.getStartMark())
  • Smart code suggestions by Codota
}
origin: redisson/redisson

  @Override
  public Object construct(Node node) {
    throw new ConstructorException(null, null,
        "could not determine a constructor for the tag " + node.getTag(),
        node.getStartMark());
  }
}
origin: eclipse/winery

public YAMLParserException interpret(ConstructorException e) {
  String context = "";
  if (e.getCause() instanceof MarkedYAMLException) {
    context = ((MarkedYAMLException) e.getCause()).getContext();
  } else {
    return new InvalidYamlSyntax(e.toString());
  }
  String messagePattern = "The property= '{}' could not be interpreted by the SnakeYAML parser\n{}";
  String invalidDescription = "Cannot create property=description.*";
  if (context.matches(invalidDescription)) {
    return new InvalidYamlSyntax(messagePattern, "description", e);
  }
  String invalidType = "Cannot create property=metadata.*";
  if (context.matches(invalidType)) {
    return new InvalidYamlSyntax(messagePattern, "metadata", e);
  }
  return new InvalidYamlSyntax(e.toString());
}
origin: geotools/geotools

  @Test
  public void testDeserializationAttempt() throws Exception {
    try {
      String yaml = "!!java.util.Date\n" + "date: 25\n" + "month: 12\n" + "year: 2016";
      Ysld.parse(yaml);
      fail("Expected parsing to fail");
    } catch (ConstructorException e) {
      assertThat(e.getMessage(), containsString("could not determine a constructor"));
    }
  }
}
origin: redisson/redisson

protected Object constructObjectNoCheck(Node node) {
  if (recursiveObjects.contains(node)) {
    throw new ConstructorException(null, null, "found unconstructable recursive node",
        node.getStartMark());
  }
  recursiveObjects.add(node);
  Construct constructor = getConstructor(node);
  Object data = (constructedObjects.containsKey(node)) ? constructedObjects.get(node)
      : constructor.construct(node);
  finalizeConstruction(node, data);
  constructedObjects.put(node, data);
  recursiveObjects.remove(node);
  if (node.isTwoStepsConstruction()) {
    constructor.construct2ndStep(node, data);
  }
  return data;
}
origin: redisson/redisson

  public void construct2ndStep(Node node, Object object) {
    try {
      getConstructor(node).construct2ndStep(node, object);
    } catch (Exception e) {
      throw new ConstructorException(
          null, null, "Can't construct a second step for a java object for "
              + node.getTag() + "; exception=" + e.getMessage(),
          node.getStartMark(), e);
    }
  }
}
origin: redisson/redisson

public Object construct(Node node) {
  try {
    return getConstructor(node).construct(node);
  } catch (ConstructorException e) {
    throw e;
  } catch (Exception e) {
    throw new ConstructorException(null, null, "Can't construct a java object for "
        + node.getTag() + "; exception=" + e.getMessage(), node.getStartMark(), e);
  }
}
origin: redisson/redisson

throw new ConstructorException("while constructing a mapping",
    node.getStartMark(), "found unacceptable key " + key,
    tuple.getKeyNode().getStartMark(), e);
origin: redisson/redisson

  result = javaConstructor.newInstance(argument);
} catch (Exception e) {
  throw new ConstructorException(null, null,
      "Can't construct a java object for scalar " + node.getTag()
          + "; exception=" + e.getMessage(),
origin: redisson/redisson

  throw new ConstructorException("while constructing pairs", node.getStartMark(),
      "expected a sequence, but found " + node.getNodeId(), node.getStartMark());
for (Node subnode : snode.getValue()) {
  if (!(subnode instanceof MappingNode)) {
    throw new ConstructorException("while constructingpairs", node.getStartMark(),
        "expected a mapping of length 1, but found " + subnode.getNodeId(),
        subnode.getStartMark());
    throw new ConstructorException("while constructing pairs", node.getStartMark(),
        "expected a single mapping item, but found " + mnode.getValue().size()
            + " items",
origin: redisson/redisson

  throw new ConstructorException("while constructing an ordered map",
      node.getStartMark(), "expected a sequence, but found " + node.getNodeId(),
      node.getStartMark());
for (Node subnode : snode.getValue()) {
  if (!(subnode instanceof MappingNode)) {
    throw new ConstructorException("while constructing an ordered map",
        node.getStartMark(),
        "expected a mapping of length 1, but found " + subnode.getNodeId(),
    throw new ConstructorException("while constructing an ordered map",
        node.getStartMark(), "expected a single mapping item, but found "
            + mnode.getValue().size() + " items",
origin: redisson/redisson

protected void constructSet2ndStep(MappingNode node, Set<Object> set) {
  List<NodeTuple> nodeValue = node.getValue();
  for (NodeTuple tuple : nodeValue) {
    Node keyNode = tuple.getKeyNode();
    Object key = constructObject(keyNode);
    if (key != null) {
      try {
        key.hashCode();// check circular dependencies
      } catch (Exception e) {
        throw new ConstructorException("while constructing a Set", node.getStartMark(),
            "found unacceptable key " + key, tuple.getKeyNode().getStartMark(), e);
      }
    }
    if (keyNode.isTwoStepsConstruction()) {
      /*
       * if keyObject is created it 2 steps we should postpone putting
       * it into the set because it may have different hash after
       * initialization compared to clean just created one. And set of
       * course does not observe value hashCode changes.
       */
      sets2fill.add(0, new RecursiveTuple<Set<Object>, Object>(set, key));
    } else {
      set.add(key);
    }
  }
}
origin: redisson/redisson

for (Node subnode : vals) {
  if (!(subnode instanceof MappingNode)) {
    throw new ConstructorException("while constructing a mapping",
        node.getStartMark(),
        "expected a mapping for merging, but found "
throw new ConstructorException("while constructing a mapping",
    node.getStartMark(),
    "expected a mapping or list of mappings for merging, but found "
origin: redisson/redisson

throw new ConstructorException("while constructing a mapping",
    node.getStartMark(), "found unacceptable key " + key,
    tuple.getKeyNode().getStartMark(), e);
origin: redisson/redisson

  throw e;
} catch (Exception e) {
  throw new ConstructorException(
      "Cannot create property=" + key + " for JavaBean=" + object,
      node.getStartMark(), e.getMessage(), valueNode.getStartMark(), e);
origin: pl.droidsonroids.yaml/snakeyaml

  public Object construct(Node node) {
    throw new ConstructorException(null, null,
        "could not determine a constructor for the tag " + node.getTag(),
        node.getStartMark());
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  @Override
  public Object construct(Node node) {
    throw new ConstructorException(null, null,
        "could not determine a constructor for the tag " + node.getTag(),
        node.getStartMark());
  }
}
origin: harbby/presto-connectors

  public Object construct(Node node) {
    throw new ConstructorException(null, null,
        "could not determine a constructor for the tag " + node.getTag(),
        node.getStartMark());
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

protected Object constructObjectNoCheck(Node node) {
  if (recursiveObjects.contains(node)) {
    throw new ConstructorException(null, null, "found unconstructable recursive node",
        node.getStartMark());
  }
  recursiveObjects.add(node);
  Construct constructor = getConstructor(node);
  Object data = (constructedObjects.containsKey(node)) ? constructedObjects.get(node)
      : constructor.construct(node);
  finalizeConstruction(node, data);
  constructedObjects.put(node, data);
  recursiveObjects.remove(node);
  if (node.isTwoStepsConstruction()) {
    constructor.construct2ndStep(node, data);
  }
  return data;
}
origin: pl.droidsonroids.yaml/snakeyaml

  public void construct2ndStep(Node node, Object object) {
    try {
      getConstructor(node).construct2ndStep(node, object);
    } catch (Exception e) {
      throw new ConstructorException(null, null,
          "Can't construct a second step for a java object for " + node.getTag()
              + "; exception=" + e.getMessage(), node.getStartMark(), e);
    }
  }
}
origin: harbby/presto-connectors

  public void construct2ndStep(Node node, Object object) {
    try {
      getConstructor(node).construct2ndStep(node, object);
    } catch (Exception e) {
      throw new ConstructorException(null, null,
          "Can't construct a second step for a java object for " + node.getTag()
              + "; exception=" + e.getMessage(), node.getStartMark(), e);
    }
  }
}
org.yaml.snakeyaml.constructorConstructorException

Most used methods

  • <init>
  • getCause
  • getMessage
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)