org.apache.vysper.xmpp.addressing.stringprep
Class ResourcePrep

java.lang.Object
  extended by org.apache.vysper.xmpp.addressing.stringprep.StringPrep
      extended by org.apache.vysper.xmpp.addressing.stringprep.ResourcePrep

public class ResourcePrep
extends StringPrep

This class is used to prepare a Resource Identifier for further usage. see RFC3920:3.4 see RFC3920:Appendix B see http://www.ietf.org/rfc/rfc3920.txt

Author:
Gerolf Seitz (gseitz@apache.org)

Method Summary
protected  java.util.Map<java.lang.String,java.lang.String> buildMapping()
          Override this method and return a custom map of character mappings to alter the Stringprep behavior.
protected  java.util.Set<java.lang.String> buildProhibitedSet()
          Override this method and return a custom set of prohibited characters to alter the Stringprep behavior.
static java.lang.String prepare(java.lang.String resource)
          Applies the Resourceprep profile to the given resource.
 
Methods inherited from class org.apache.vysper.xmpp.addressing.stringprep.StringPrep
prepareString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prepare

public static java.lang.String prepare(java.lang.String resource)
                                throws StringPrepViolationException
Applies the Resourceprep profile to the given resource.

Parameters:
resource - the resource to prepare
Returns:
the prepared resource
Throws:
StringPrepViolationException - in case the Resourceprep profile can't be applied

buildMapping

@SpecCompliant(spec="RFC3920",
               section="B.3",
               status=FINISHED)
protected java.util.Map<java.lang.String,java.lang.String> buildMapping()
Description copied from class: StringPrep
Override this method and return a custom map of character mappings to alter the Stringprep behavior.

Overrides:
buildMapping in class StringPrep
Returns:
a Map containing all character mappings

buildProhibitedSet

@SpecCompliant(spec="RFC3920",
               section="B.5",
               status=FINISHED)
protected java.util.Set<java.lang.String> buildProhibitedSet()
Description copied from class: StringPrep
Override this method and return a custom set of prohibited characters to alter the Stringprep behavior.

Overrides:
buildProhibitedSet in class StringPrep
Returns:
a Set containing all characters that are prohibited