@Override public NodeRule<?> getItemRule() { if (itemType instanceof Class<?>) { //TODO add it to a list to invoke onRuleEnd on all the rules created if (!ReflectionUtils.isPojo((Class) itemType)) { return getScalarRule(); } return new PojoTupleRule("", (Class<?>) itemType, getNodeRuleFactory()); } if (itemType instanceof ParameterizedType) { ParameterizedType pItemType = (ParameterizedType) itemType; if (Map.class.isAssignableFrom((Class<?>) pItemType.getRawType())) { //sequence of maps return new MapTupleRule((Class<?>) pItemType.getActualTypeArguments()[1], getNodeRuleFactory()); } } throw new IllegalArgumentException("Sequence item type not supported: " + itemType); }
@Override public NodeRule<?> getItemRule() { if (itemType instanceof Class<?>) { //TODO add it to a list to invoke onRuleEnd on all the rules created if (!ReflectionUtils.isPojo((Class) itemType)) { return getScalarRule(); } return new PojoTupleRule("", (Class<?>) itemType, getNodeRuleFactory()); } if (itemType instanceof ParameterizedType) { ParameterizedType pItemType = (ParameterizedType) itemType; if (Map.class.isAssignableFrom((Class<?>) pItemType.getRawType())) { //sequence of maps return new MapTupleRule((Class<?>) pItemType.getActualTypeArguments()[1], getNodeRuleFactory()); } } throw new IllegalArgumentException("Sequence item type not supported: " + itemType); }
@Override public TupleRule<?, ?> deepCopy() { checkClassToCopy(SequenceTupleRule.class); SequenceTupleRule copy = new SequenceTupleRule(getName(), itemType, getNodeRuleFactory()); copy.setHandler(getHandler()); copy.setRequired(isRequired()); return copy; }
@Override public TupleRule<?, ?> deepCopy() { checkClassToCopy(SequenceTupleRule.class); SequenceTupleRule copy = new SequenceTupleRule(getName(), itemType, getNodeRuleFactory()); copy.setHandler(getHandler()); copy.setRequired(isRequired()); return copy; }