/** * Add a single attribute to that domain with the specified value * * @param domain * @param attributeValue */ private static void addAttribute(DomainType domain, String attributeValue) { AttributeType attribute = Utils.OBJECT_FACTORY.createAttributeType(); attribute.setAttribute(attributeValue); List<AttributeType> listAttributes = domain.getAttributes(); listAttributes.add(attribute); }
/** * Get the attributes from the specified domain. The boolean specifies whether we need to add a * domain prefix before returning the attributes. * * @param domain * @param domainPrefix * @return */ private static String getAttributesAsString( final DomainType domain, final boolean domainPrefix) { final String currentDomainName = domain.getName(); final List<AttributeType> listAttributes = domain.getAttributes(); if (!listAttributes.isEmpty()) { String attribs = null; if (listAttributes.size() == 1) { attribs = listAttributes.get(0).getAttribute().trim(); } else { // Only support up to 2 attributes (start;end/low;high/...) String attr0 = listAttributes.get(0).getAttribute().trim(); String attr1 = listAttributes.get(1).getAttribute().trim(); attribs = attr0 + ";" + attr1; } if (domainPrefix) { return currentDomainName + "(" + attribs + ")"; } else { return attribs; } } return null; }