protected void printArchetypeSlot(ArchetypeSlot slot, Element out) { Element children = new Element("children", defaultNamespace); out.getChildren().add(children); children.setAttribute("type", "ARCHETYPE_SLOT", xsiNamespace); printCObjectElements(slot, children); // print all attributes if (!slot.isAnyAllowed()) { if (slot.getIncludes() != null) { for (Assertion include : slot.getIncludes()) { Element includes = new Element("includes", defaultNamespace); children.getChildren().add(includes); printAssertion(include, includes); } } if (slot.getExcludes() != null) { for (Assertion exclude : slot.getExcludes()) { Element excludes = new Element("excludes", defaultNamespace); children.getChildren().add(excludes); printAssertion(exclude, excludes); } } } }
/** * Checks the assertions of an archetype for validity * * @param slot * @param rmAttrType * @param archetype * @param errors */ private void checkArchetypeSlot(ArchetypeSlot slot, Class rmAttrType, Archetype archetype, List<ValidationError> errors) { if (slot.getIncludes() != null) { for (Assertion include : slot.getIncludes()) { checkAssertionHasValidArchetypeIds(include, slot, errors); } } if (slot.getExcludes() != null) { for (Assertion exclude : slot.getExcludes()) { checkAssertionHasValidArchetypeIds(exclude, slot, errors); } } }
protected void printArchetypeSlot(ArchetypeSlot slot, int indent, Writer out) throws IOException { indent(indent, out); out.write("allow_archetype "); out.write(slot.getRmTypeName()); if (StringUtils.isNotEmpty(slot.getNodeId())) { out.write("[" + slot.getNodeId() + "]"); } printOccurrences(slot.getOccurrences(), out); out.write(" matches {"); if (slot.isAnyAllowed()) { out.write("*}"); } else { if (slot.getIncludes() != null) { printAssertions(slot.getIncludes(), "include", indent, out); } if (slot.getExcludes() != null) { printAssertions(slot.getExcludes(), "exclude", indent, out); } newline(out); indent(indent, out); out.write("}"); } newline(out); }
protected void printArchetypeSlot(ArchetypeSlot slot, int indent, Writer out) throws IOException { indent(indent, out); out.write("allow_archetype "); out.write(slot.getRmTypeName()); if (StringUtils.isNotEmpty(slot.getNodeId())) { out.write("[" + slot.getNodeId() + "]"); } printOccurrences(slot.getOccurrences(), out); out.write(" matches {"); if (slot.isAnyAllowed()) { out.write("*}"); } else { if (slot.getIncludes() != null) { printAssertions(slot.getIncludes(), "include", indent, out); } if (slot.getExcludes() != null) { printAssertions(slot.getExcludes(), "exclude", indent, out); } newline(out); indent(indent, out); out.write("}"); } newline(out); }