On Thu 06 Mar 2025 at 09:57 -0600, Shawn McKinney wrote:

> What do the API changes look like? Do you have a sample interface?

I was thinking that an obvious first step would be to copy the utility
functions for Postal Address syntax from Studio (where they were added
by myself a few years ago):

https://github.com/apache/directory-studio/blob/master/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java

Then they'd show up in the API libraries like this:


package org.apache.directory.api.util;

/**
 * Create decoders and encoders for the RFC 4517 Postal Address syntax.
 *
 * <pre>
 * PostalAddress = line *( DOLLAR line )
 * line          = 1*line-char
 * line-char     = %x00-23
 *                 / (%x5C "24")  ; escaped "$"
 *                 / %x25-5B
 *                 / (%x5C "5C")  ; escaped "\"
 *                 / %x5D-7F
 *                 / UTFMB
 * </pre>
 */
public final class PostalAddress
{
    /**
     * Creates a decoder that uses the specified line separator.
     *
     * @param separator the separator to output between address lines
     * @return a commons-text translator object for decoding
     */
    public static CharSequenceTranslator createDecoder( String separator );

    /**
     * Creates an encoder that uses the specified line separator.
     *
     * @param separator the separator used between address lines
     * @return a commons-text translator object for encoding
     */
    public static CharSequenceTranslator createEncoder( String separator );
}


(Then, once this has been released and Studio has been updated to use
that version of the API libraries, Studio will no longer need to keep
its own implementation, so we have a real first user of the functions
while also providing this functionality to others.)

Cheers // Fredrik Roubert

-- 
Forsterstrasse 64  |  +41 78 8170377
CH-8044 Zürich     |  https://roubert.name/fredrik/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org

Reply via email to