Class Dsmlv1Writer

    • Constructor Detail

      • Dsmlv1Writer

        public Dsmlv1Writer​(Writer writer)
        Creates a new dsml writer. The following transformer output properties are set by default:
        • "doctype-public", "yes"
        • "indent", "yes"
        • "{http://xml.apache.org/xslt}indent-amount", "2"
        Parameters:
        writer - to write DSML to
    • Method Detail

      • getOutputProperties

        public Map<String,​String> getOutputProperties()
        Returns the transformer output properties used by this writer.
        Returns:
        transformer output properties
      • setOutputProperties

        public void setOutputProperties​(Map<String,​String> properties)
        Sets the transformer output properties used by this writer.
        Parameters:
        properties - transformer output properties
      • createDsmlAttributes

        protected List<Element> createDsmlAttributes​(Document doc,
                                                     Collection<LdapAttribute> attrs)
        Returns a list of <dsml:attr/> elements for the supplied attributes.
        Parameters:
        doc - to source elements from
        attrs - to iterate over
        Returns:
        list of elements contains attributes
      • createAttrElement

        protected Element createAttrElement​(Document doc,
                                            LdapAttribute attr)
        Returns a <dsml:attr/> element for the supplied ldap attribute.
        Parameters:
        doc - to source elements from
        attr - ldap attribute to add
        Returns:
        element containing the attribute
      • createObjectclassElement

        protected Element createObjectclassElement​(Document doc,
                                                   LdapAttribute attr)
        Returns a <dsml:objectclass/> element for the supplied ldap attribute.
        Parameters:
        doc - to source elements from
        attr - ldap attribute to add
        Returns:
        element containing the attribute values
      • setAttrValue

        protected void setAttrValue​(Document doc,
                                    Element valueElement,
                                    String value,
                                    boolean isBase64)
        Adds the supplied string to the value element.
        Parameters:
        doc - to create nodes with
        valueElement - to append value to
        value - to create node for
        isBase64 - whether the value is base64 encoded