/** * @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; } }
/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element ace = DomUtil.createElement(document, XML_ACE, SecurityConstants.NAMESPACE); if (invert) { Element inv = DomUtil.addChildElement(ace, XML_INVERT, SecurityConstants.NAMESPACE); inv.appendChild(principal.toXml(document)); } else { ace.appendChild(principal.toXml(document)); } Element gd = DomUtil.addChildElement(ace, ((grant) ? XML_GRANT : XML_DENY), SecurityConstants.NAMESPACE); for (int i = 0; i < privileges.length; i++) { gd.appendChild(privileges[i].toXml(document)); } if (isProtected) { DomUtil.addChildElement(ace, XML_PROTECTED, SecurityConstants.NAMESPACE); } if (inheritedHref != null) { Element inh = DomUtil.addChildElement(ace, XML_INHERITED, SecurityConstants.NAMESPACE); inh.appendChild(DomUtil.hrefToXml(inheritedHref, document)); } return ace; }
/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element ace = DomUtil.createElement(document, XML_ACE, SecurityConstants.NAMESPACE); if (invert) { Element inv = DomUtil.addChildElement(ace, XML_INVERT, SecurityConstants.NAMESPACE); inv.appendChild(principal.toXml(document)); } else { ace.appendChild(principal.toXml(document)); } Element gd = DomUtil.addChildElement(ace, ((grant) ? XML_GRANT : XML_DENY), SecurityConstants.NAMESPACE); for (Privilege privilege : privileges) { gd.appendChild(privilege.toXml(document)); } if (isProtected) { DomUtil.addChildElement(ace, XML_PROTECTED, SecurityConstants.NAMESPACE); } if (inheritedHref != null) { Element inh = DomUtil.addChildElement(ace, XML_INHERITED, SecurityConstants.NAMESPACE); inh.appendChild(DomUtil.hrefToXml(inheritedHref, document)); } return ace; }
/** * @see XmlSerializable#toXml(Document) */ public Element toXml(Document document) { Element ace = DomUtil.createElement(document, XML_ACE, SecurityConstants.NAMESPACE); if (invert) { Element inv = DomUtil.addChildElement(ace, XML_INVERT, SecurityConstants.NAMESPACE); inv.appendChild(principal.toXml(document)); } else { ace.appendChild(principal.toXml(document)); } Element gd = DomUtil.addChildElement(ace, ((grant) ? XML_GRANT : XML_DENY), SecurityConstants.NAMESPACE); for (Privilege privilege : privileges) { gd.appendChild(privilege.toXml(document)); } if (isProtected) { DomUtil.addChildElement(ace, XML_PROTECTED, SecurityConstants.NAMESPACE); } if (inheritedHref != null) { Element inh = DomUtil.addChildElement(ace, XML_INHERITED, SecurityConstants.NAMESPACE); inh.appendChild(DomUtil.hrefToXml(inheritedHref, document)); } return ace; }