/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element spElem = DomUtil.createElement(document, XML_SUPPORTED_PRIVILEGE, SecurityConstants.NAMESPACE); spElem.appendChild(privilege.toXml(document)); if (isAbstract) { DomUtil.addChildElement(spElem, XML_ABSTRACT, SecurityConstants.NAMESPACE); } if (description != null) { Element desc = DomUtil.addChildElement(spElem, XML_DESCRIPTION, SecurityConstants.NAMESPACE, description); if (descriptionLanguage != null) { DomUtil.setAttribute(desc, "lang", Namespace.XML_NAMESPACE, descriptionLanguage); } } if (supportedPrivileges != null) { for (SupportedPrivilege supportedPrivilege : supportedPrivileges) { spElem.appendChild(supportedPrivilege.toXml(document)); } } return spElem; }
/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element spElem = DomUtil.createElement(document, XML_SUPPORTED_PRIVILEGE, SecurityConstants.NAMESPACE); spElem.appendChild(privilege.toXml(document)); if (isAbstract) { DomUtil.addChildElement(spElem, XML_ABSTRACT, SecurityConstants.NAMESPACE); } if (description != null) { Element desc = DomUtil.addChildElement(spElem, XML_DESCRIPTION, SecurityConstants.NAMESPACE, description); if (descriptionLanguage != null) { DomUtil.setAttribute(desc, "lang", Namespace.XML_NAMESPACE, descriptionLanguage); } } if (supportedPrivileges != null) { for (SupportedPrivilege supportedPrivilege : supportedPrivileges) { spElem.appendChild(supportedPrivilege.toXml(document)); } } return spElem; }
/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element spElem = DomUtil.createElement(document, XML_SUPPORTED_PRIVILEGE, SecurityConstants.NAMESPACE); spElem.appendChild(privilege.toXml(document)); if (isAbstract) { DomUtil.addChildElement(spElem, XML_ABSTRACT, SecurityConstants.NAMESPACE); } if (description != null) { Element desc = DomUtil.addChildElement(spElem, XML_DESCRIPTION, SecurityConstants.NAMESPACE, description); if (descriptionLanguage != null) { DomUtil.setAttribute(desc, "lang", Namespace.XML_NAMESPACE, descriptionLanguage); } } if (supportedPrivileges != null) { for (int i = 0; i < supportedPrivileges.length; i++) { spElem.appendChild(supportedPrivileges[i].toXml(document)); } } return spElem; } }