/** * Create an AttributeStatement given an attribute * @param attributeValue * @return */ public static AttributeStatementType createAttributeStatement(String attributeValue) { AttributeStatementType attribStatement = new AttributeStatementType(); AttributeType att = new AttributeType( attributeValue ); att.addAttributeValue(attributeValue); attribStatement.addAttribute( new ASTChoiceType( att )); return attribStatement; }
public static Map<String, Object> asMap(Set<AttributeStatementType> attributeStatementTypes) { Map<String, Object> attrMap = new HashMap<String, Object>(); if (attributeStatementTypes != null && !attributeStatementTypes.isEmpty()) { attrMap = new HashMap<String, Object>(); for (StatementAbstractType statement : attributeStatementTypes) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStat = (AttributeStatementType) statement; List<ASTChoiceType> attrs = attrStat.getAttributes(); for (ASTChoiceType attrChoice : attrs) { AttributeType attr = attrChoice.getAttribute(); String attributeName = attr.getFriendlyName(); if (attributeName == null) { attributeName = attr.getName(); } List<Object> values = attr.getAttributeValue(); if (values != null) { if (values.size() == 1) { attrMap.put(attributeName, values.get(0)); } else { attrMap.put(attributeName, values); } } } } } } return attrMap; }
AttributeStatementType singleStatement = new AttributeStatementType(); singleStatement.addAttributes(statement.getAttributes());
/** * Create an empty attribute statement * * @return */ public static AttributeStatementType createAttributeStatement() { return new AttributeStatementType(); }
public static Map<String, Object> asMap(Set<AttributeStatementType> attributeStatementTypes) { Map<String, Object> attrMap = new HashMap<String, Object>(); if (attributeStatementTypes != null && !attributeStatementTypes.isEmpty()) { attrMap = new HashMap<String, Object>(); for (StatementAbstractType statement : attributeStatementTypes) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStat = (AttributeStatementType) statement; List<ASTChoiceType> attrs = attrStat.getAttributes(); for (ASTChoiceType attrChoice : attrs) { AttributeType attr = attrChoice.getAttribute(); String attributeName = attr.getFriendlyName(); if (attributeName == null) { attributeName = attr.getName(); } List<Object> values = attr.getAttributeValue(); if (values != null) { if (values.size() == 1) { attrMap.put(attributeName, values.get(0)); } else { attrMap.put(attributeName, values); } } } } } } return attrMap; }
AttributeStatementType singleStatement = new AttributeStatementType(); singleStatement.addAttributes(statement.getAttributes());
/** * Create an empty attribute statement * * @return */ public static AttributeStatementType createAttributeStatement() { return new AttributeStatementType(); }
/** * Create an AttributeStatement given an attribute * * @param attributeValue * * @return */ public static AttributeStatementType createAttributeStatement(String attributeValue) { AttributeStatementType attribStatement = new AttributeStatementType(); AttributeType att = new AttributeType(attributeValue); att.addAttributeValue(attributeValue); attribStatement.addAttribute(new ASTChoiceType(att)); return attribStatement; }
if (statement instanceof AttributeStatementType) { AttributeStatementType attributeStatement = (AttributeStatementType) statement; List<ASTChoiceType> attList = attributeStatement.getAttributes(); for (ASTChoiceType obj : attList) { AttributeType attr = obj.getAttribute();
/** * Create an empty attribute statement * * @return */ public static AttributeStatementType createAttributeStatement() { return new AttributeStatementType(); }
/** * Given an attribute type and a value, create {@link AttributeStatementType} * * @param key attribute type * @param value attribute value * * @return */ public static AttributeStatementType createAttributeStatement(String key, String value) { AttributeStatementType attrStatement = new AttributeStatementType(); AttributeType attr = new AttributeType(key); attr.addAttributeValue(value); attrStatement.addAttribute(new ASTChoiceType(attr)); return attrStatement; }
if (statement instanceof AttributeStatementType) { AttributeStatementType attributeStatement = (AttributeStatementType) statement; List<ASTChoiceType> attList = attributeStatement.getAttributes(); for (ASTChoiceType obj : attList) { AttributeType attr = obj.getAttribute();
/** * Create an empty attribute statement * @return */ public static AttributeStatementType createAttributeStatement() { return new AttributeStatementType(); }
/** * Create an AttributeStatement given an attribute * * @param attributeValue * @return */ public static AttributeStatementType createAttributeStatement(String attributeValue) { AttributeStatementType attribStatement = new AttributeStatementType(); AttributeType att = new AttributeType(attributeValue); att.addAttributeValue(attributeValue); attribStatement.addAttribute(new ASTChoiceType(att)); return attribStatement; }
List<ASTChoiceType> attList = attributeStatement.getAttributes(); for (ASTChoiceType obj : attList)
/** * Create an empty attribute statement * @return */ public static AttributeStatementType createAttributeStatement() { return new AttributeStatementType(); }
/** * Given an attribute type and a value, create {@link AttributeStatementType} * @param key attribute type * @param value attribute value * @return */ public static AttributeStatementType createAttributeStatement(String key, String value) { AttributeStatementType attrStatement = new AttributeStatementType(); AttributeType attr = new AttributeType(key); attr.addAttributeValue(value); attrStatement.addAttribute(new ASTChoiceType(attr)); return attrStatement; }
List<ASTChoiceType> attList = attributeStatement.getAttributes(); for (ASTChoiceType obj : attList)
/** * Create an AttributeStatement given an attribute * @param attributeValue * @return */ public static AttributeStatementType createAttributeStatement(String attributeValue) { AttributeStatementType attribStatement = new AttributeStatementType(); AttributeType att = new AttributeType( attributeValue ); att.addAttributeValue(attributeValue); attribStatement.addAttribute( new ASTChoiceType( att )); return attribStatement; }
if (statement instanceof AttributeStatementType) { AttributeStatementType attributeStatement = (AttributeStatementType) statement; List<ASTChoiceType> attList = attributeStatement.getAttributes(); for (ASTChoiceType obj : attList) { AttributeType attr = obj.getAttribute();