public static FeatureAnnotation featureBranch(String id) { return new FeatureAnnotation(FEATURE_BRANCH).setElement(FEATURE_BRANCH_ID, id); }
public static FeatureAnnotation parentChildrenBranch(boolean batch) { return parentChildrenBranch().setElement(FEATURE_BRANCH_BATCH, String.valueOf(batch)); }
public List<String> getElementAsList(String name) { return parseList(elems.get(name)); }
public static FeatureAnnotation specBranch(boolean spec, boolean batch) { return specBranch(spec).setElement(FEATURE_BRANCH_BATCH, String.valueOf(batch)); }
for (FeatureAnnotation fa : featureSpec.getAnnotations()) { final ElementNode annotationE = addElement(specE, Element.ANNOTATION); addAttribute(annotationE, Attribute.NAME, fa.getName()); if (fa.hasElements()) { for (Map.Entry<String, String> entry : fa.getElements().entrySet()) { final ElementNode elemE = addElement(annotationE, Element.ELEM); addAttribute(elemE, Attribute.NAME, entry.getKey());
branchId = newFb.getElement(FeatureAnnotation.FEATURE_BRANCH_ID); } else { Boolean specBranch = null; final String elem = newFb.getElement(FeatureAnnotation.FEATURE_BRANCH_SPEC); if(elem != null) { specBranch = Boolean.parseBoolean(elem); final String elem = newFb.getElement(FeatureAnnotation.FEATURE_BRANCH_BATCH); if(elem == null) { branchBatch = null; parentChildrenBranch = newFb.hasElement(FeatureAnnotation.FEATURE_BRANCH_PARENT_CHILDREN); } else { branchBatch = null;
public FeatureAnnotation setElement(String name) { return setElement(name, null); }
public Builder addAnnotation(FeatureAnnotation annotation) { annotations = CollectionUtils.putLinked(annotations, annotation.getName(), annotation); return this; }
throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.NAME)); final FeatureAnnotation fa = new FeatureAnnotation(name); while (reader.hasNext()) { switch (reader.nextTag()) {
private void parseAnnotationElem(XMLExtendedStreamReader reader, FeatureAnnotation fa) throws XMLStreamException { String name = null; String value = null; for (int i = 0; i < reader.getAttributeCount(); i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i)); switch (attribute) { case NAME: name = reader.getAttributeValue(i); break; case VALUE: value = reader.getAttributeValue(i); break; default: throw ParsingUtils.unexpectedAttribute(reader, i); } } if(name == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.NAME)); } ParsingUtils.parseNoContent(reader); fa.setElement(name, value); }
public static FeatureAnnotation parentChildrenBranch() { return new FeatureAnnotation(FEATURE_BRANCH).setElement(FEATURE_BRANCH_PARENT_CHILDREN); }
public List<String> getElementAsList(String name, String defaultValue) { return parseList(elems.getOrDefault(name, defaultValue)); }
public static FeatureAnnotation featureBranch(String id, boolean batch) { return new FeatureAnnotation(FEATURE_BRANCH) .setElement(FEATURE_BRANCH_ID, id) .setElement(FEATURE_BRANCH_BATCH, String.valueOf(batch)); }
public static FeatureAnnotation specBranch(boolean spec) { return new FeatureAnnotation(FEATURE_BRANCH).setElement(FEATURE_BRANCH_SPEC, String.valueOf(spec)); }