Beispiel #1
0
 public static boolean isValueNode(Node node) {
   Class nodeClass = node.getClass();
   return nodeClass == Node.class
       || nodeClass == ApplicationNode.class
       || nodeClass == ArrayNode.class
       || node instanceof PrimitiveNode
       || nodeClass == XMLNode.class
       || nodeClass == XMLListNode.class
       || nodeClass == ModelNode.class
       || nodeClass == InlineComponentNode.class;
 }
Beispiel #2
0
  public void invoke(Node node) {
    Class nodeClass = node.getClass();

    if (nodeClass == Node.class || nodeClass == ApplicationNode.class) {
      componentNode(node);
    } else if (nodeClass == ArrayNode.class) {
      arrayNode((ArrayNode) node);
    } else if (node instanceof PrimitiveNode) {
      primitiveNode((PrimitiveNode) node);
    } else if (nodeClass == XMLNode.class) {
      xmlNode((XMLNode) node);
    } else if (nodeClass == XMLListNode.class) {
      xmlListNode((XMLListNode) node);
    } else if (nodeClass == ModelNode.class) {
      modelNode((ModelNode) node);
    } else if (nodeClass == InlineComponentNode.class) {
      inlineComponentNode((InlineComponentNode) node);
    } else {
      assert !isValueNode(node) : "value node class not handled by invoke()";
      unknown(node);
    }
  }