Examples of BooleanNode


Examples of com.fasterxml.jackson.databind.node.BooleanNode

        String nodeStr = mapper.writeValueAsString(node);
        if (node instanceof ObjectNode) {
            JsonSchema innerSchema = mapper.readValue(nodeStr, JsonSchema.class);
            return new ObjectSchema.SchemaAdditionalProperties(innerSchema);
        } else if (node instanceof BooleanNode) {
            BooleanNode booleanNode = (BooleanNode) node;
            if (booleanNode.booleanValue()) {
                return null; // "additionalProperties":true is the default
            } else {
                return ObjectSchema.NoAdditionalProperties.instance;
            }
        } else {
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.BooleanNode

            ObjectMapper mapper = (ObjectMapper) jp.getCodec();
      JsonSchema innerSchema = mapper.treeToValue(node, JsonSchema.class);
      return new ArraySchema.SchemaAdditionalItems(innerSchema);
    }
    if (node instanceof BooleanNode) {
      BooleanNode booleanNode = (BooleanNode) node;
      if (booleanNode.booleanValue()) {
        return null; // "additionalItems":true is the default
      }
      return new ArraySchema.NoAdditionalItems();
    }
    throw new JsonMappingException("additionalItems nodes can only be of "
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.BooleanNode

    public void applyAddsTextWhenRequired() throws JClassAlreadyExistsException {

        JDefinedClass jclass = new JCodeModel()._class(TARGET_CLASS_NAME);

        ObjectMapper mapper = new ObjectMapper();
        BooleanNode descriptionNode = mapper.createObjectNode().booleanNode(true);

        JDocComment result = rule.apply("fooBar", descriptionNode, jclass, null);

        assertThat(result, sameInstance(jclass.javadoc()));
        assertThat(result.size(), is(1));
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.BooleanNode

    public void applySkipsTextWhenNotRequired() throws JClassAlreadyExistsException {

        JDefinedClass jclass = new JCodeModel()._class(TARGET_CLASS_NAME);

        ObjectMapper mapper = new ObjectMapper();
        BooleanNode descriptionNode = mapper.createObjectNode().booleanNode(false);

        JDocComment result = rule.apply("fooBar", descriptionNode, jclass, null);

        assertThat(result, sameInstance(jclass.javadoc()));
        assertThat(result.size(), is(0));
View Full Code Here

Examples of com.google.template.soy.exprtree.BooleanNode

  public static PrimitiveNode convertPrimitiveDataToExpr(PrimitiveData primitiveData) {

    if (primitiveData instanceof StringData) {
      return new StringNode(primitiveData.stringValue());
    } else if (primitiveData instanceof BooleanData) {
      return new BooleanNode(primitiveData.booleanValue());
    } else if (primitiveData instanceof IntegerData) {
      return new IntegerNode(primitiveData.integerValue());
    } else if (primitiveData instanceof FloatData) {
      return new FloatNode(primitiveData.floatValue());
    } else if (primitiveData instanceof NullData) {
View Full Code Here

Examples of com.google.template.soy.exprtree.BooleanNode

   */
  private static class ReplaceHasDataFunctionInExprVisitor extends AbstractExprNodeVisitor<Void> {

    @Override protected void visitFunctionNode(FunctionNode node) {
      if (node.getFunctionName().equals("hasData")) {
        node.getParent().replaceChild(node, new BooleanNode(true));
      }
    }
View Full Code Here

Examples of com.google.template.soy.exprtree.BooleanNode

      return// cannot simplify
    }

    ExprNode replacementNode;
    if (operand0 != null && operand1 != null) {
      replacementNode = new BooleanNode(operand0.toBoolean() && operand1.toBoolean());
    } else if (operand0 != null) {
      replacementNode = operand0.toBoolean() ? node.getChild(1) : new BooleanNode(false);
    } else /*(operand1 != null)*/ {
      replacementNode = operand1.toBoolean() ? node.getChild(0) : new BooleanNode(false);
    }

    node.getParent().replaceChild(node, replacementNode);
  }
View Full Code Here

Examples of com.google.template.soy.exprtree.BooleanNode

      return// cannot simplify
    }

    ExprNode replacementNode;
    if (operand0 != null && operand1 != null) {
      replacementNode = new BooleanNode(operand0.toBoolean() || operand1.toBoolean());
    } else if (operand0 != null) {
      replacementNode = operand0.toBoolean() ? new BooleanNode(true) : node.getChild(1);
    } else /*(operand1 != null)*/ {
      replacementNode = operand1.toBoolean() ? new BooleanNode(true) : node.getChild(0);
    }

    node.getParent().replaceChild(node, replacementNode);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.