/** * Perform localprep on the input String. * * @param string the input String. * @return the localpreped String. * @throws XmppStringprepException if the input String can not be transformed. */ public static String localprep(String string) throws XmppStringprepException { if (xmppStringprep == null) { return string; } // Avoid cache lookup if string is the empty string throwIfEmptyString(string); String res = NODEPREP_CACHE.lookup(string); if (res != null) { return res; } res = xmppStringprep.localprep(string); NODEPREP_CACHE.put(string, res); return res; }
/** * Perform resourceprep on the input String. * * @param string the input String. * @return the resourceprep String. * @throws XmppStringprepException if the input String can not be transformed. */ public static String resourceprep(String string) throws XmppStringprepException { if (xmppStringprep == null) { return string; } // Avoid cache lookup if string is the empty string throwIfEmptyString(string); String res = RESOURCEPREP_CACHE.lookup(string); if (res != null) { return res; } res = xmppStringprep.resourceprep(string); RESOURCEPREP_CACHE.put(string, res); return res; }
/** * Perform domainprep on the input String. * * @param string the input String. * @return the domainprep String. * @throws XmppStringprepException if the input String can not be transformed. */ public static String domainprep(String string) throws XmppStringprepException { if (xmppStringprep == null) { return string; } // Avoid cache lookup if string is the empty string throwIfEmptyString(string); String res = DOMAINPREP_CACHE.lookup(string); if (res != null) { return res; } res = xmppStringprep.domainprep(string); DOMAINPREP_CACHE.put(string, res); return res; }