org.universAAL.middleware.container.utils
Class StringUtils

Package class diagram package StringUtils
java.lang.Object
  extended by org.universAAL.middleware.container.utils.StringUtils

public class StringUtils
extends Object

A set of utility methods for Strings.

Author:
mtazari - Saied Tazari, Carsten Stockloew

Constructor Summary
StringUtils()
           
 
Method Summary
static boolean areEqualPropPaths(String[] pp1, String[] pp2)
          Tests whether two property paths are equal, i.e. have the same length and all elements are equal.
static String createUniqueID()
          Create a unique ID.
static String deriveLabel(String arg)
          This method tries to derive a meaningful label from a given String.
static boolean isAsciiLetter(char c)
          Determines if the specified character is a letter [a-z,A-Z].
static boolean isDigit(char c)
          Determines if the specified character is a digit [0-9].
static boolean isNonEmpty(String arg)
          Determines if the specified String is not null and not empty.
static boolean isNullOrEmpty(String arg)
          Determines if the specified String is null or empty.
static boolean isQualifiedName(String uri)
          Determines if the specified URI String is a qualified name.
static boolean isQuote(char c)
          Determines if the specified character is one of " ' ` ´.
static boolean startsWithURIScheme(String arg)
          Determines if a prefix of the specified String is conform to an URI definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

createUniqueID

public static String createUniqueID()
Create a unique ID.


areEqualPropPaths

public static boolean areEqualPropPaths(String[] pp1,
                                        String[] pp2)
Tests whether two property paths are equal, i.e. have the same length and all elements are equal.


deriveLabel

public static String deriveLabel(String arg)
This method tries to derive a meaningful label from a given String. If the String is a qualified name (see isQualifiedName(java.lang.String)), only the local part - the part after '#' - is taken. Multiple words starting with upper case letters and written in one word are separated (e.g. 'myName' is transformed to 'My Name').


isQuote

public static boolean isQuote(char c)
Determines if the specified character is one of " ' ` ´.


isDigit

public static boolean isDigit(char c)
Determines if the specified character is a digit [0-9].


isAsciiLetter

public static boolean isAsciiLetter(char c)
Determines if the specified character is a letter [a-z,A-Z].


isNullOrEmpty

public static boolean isNullOrEmpty(String arg)
Determines if the specified String is null or empty.


isNonEmpty

public static boolean isNonEmpty(String arg)
Determines if the specified String is not null and not empty.


isQualifiedName

public static boolean isQualifiedName(String uri)
Determines if the specified URI String is a qualified name. The following conditions are checked:


startsWithURIScheme

public static boolean startsWithURIScheme(String arg)
Determines if a prefix of the specified String is conform to an URI definition. The following conditions are checked:



Copyright © 2014 universAAL Consortium. All Rights Reserved.