public FeatureAnnotation setElement(String name) { return setElement(name, null); }
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 parentChildrenBranch() { return new FeatureAnnotation(FEATURE_BRANCH).setElement(FEATURE_BRANCH_PARENT_CHILDREN); }
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 static FeatureAnnotation specBranch(boolean spec) { return new FeatureAnnotation(FEATURE_BRANCH).setElement(FEATURE_BRANCH_SPEC, String.valueOf(spec)); }
public static FeatureAnnotation specBranch(boolean spec, boolean batch) { return specBranch(spec).setElement(FEATURE_BRANCH_BATCH, String.valueOf(batch)); }
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); }