* Helper method that creates the type element for the given policy type.
* @param policyType the policy type
* @return the type element
*/
private Element createTypeElement(PolicyType policyType) {
JDOMFactory factory = new DefaultJDOMFactory();
Element type = factory.element(DeviceRepositorySchemaConstants.
POLICY_DEFINITION_TYPE_ELEMENT_NAME);
// this is a bit clumsy
if (policyType == PolicyType.EMULATE_EMPHASIS_TAG) {
type.setAttribute(DeviceRepositorySchemaConstants.
POLICY_DEFINITION_TYPE_NAME_ATTRIBUTE_NAME,
PolicyType.EMULATE_EMPHASIS_TAG.getName());
}
Element element = factory.element(
policyType.getName());
type.addContent(element);
return type;
}