Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scoja.server.core
Class QStr  view QStr download QStr.java

java.lang.Object
  extended byorg.scoja.server.core.QStr

public final class QStr
extends java.lang.Object

A Qualified String is an String with explicit its explicit properties annotated. For instance, "whether it is secure to use the String as a filename" o "whether the String contains end of lines".


Field Summary
static int HAS_EOLN
           
static int HASNT_EOLN
           
static int IS_FILENAME_SECURE
           
static int ISNT_FILENAME_SECURE
           
static int NO_EXPLICIT_QUALITY
           
protected  int qualities
           
protected static java.lang.String[] QUALITY_NAMES
           
protected  java.lang.String str
           
 
Constructor Summary
QStr(java.lang.String str)
           
QStr(java.lang.String str, int qualities)
           
 
Method Summary
static QStr checked(java.lang.String str)
           
protected  void checkHasEOLN()
           
protected  void checkIsFilenameSecure()
           
 boolean hasEOLN()
           
static boolean hasEOLN(java.lang.String str)
          Check whether str contains an End of Line.
 boolean isFilenameSecure()
           
static boolean isFilenameSecure(java.lang.String str)
          Check whether it is secure to access to a file with a name containing str.
 boolean isKnownThat(int mask)
           
 int qualities()
           
 void rememberThat(int mask)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 java.lang.String unqualified()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_EXPLICIT_QUALITY

public static final int NO_EXPLICIT_QUALITY
See Also:
Constant Field Values

IS_FILENAME_SECURE

public static final int IS_FILENAME_SECURE
See Also:
Constant Field Values

ISNT_FILENAME_SECURE

public static final int ISNT_FILENAME_SECURE
See Also:
Constant Field Values

HASNT_EOLN

public static final int HASNT_EOLN
See Also:
Constant Field Values

HAS_EOLN

public static final int HAS_EOLN
See Also:
Constant Field Values

QUALITY_NAMES

protected static final java.lang.String[] QUALITY_NAMES

str

protected final java.lang.String str

qualities

protected int qualities
Constructor Detail

QStr

public QStr(java.lang.String str)

QStr

public QStr(java.lang.String str,
            int qualities)
Method Detail

isFilenameSecure

public static boolean isFilenameSecure(java.lang.String str)
Check whether it is secure to access to a file with a name containing str. Everything but File.separatorChar>File.separatorChar 55 or File.pathSeparatorChar>File.pathSeparatorChar 55 is considered a secure character.


hasEOLN

public static boolean hasEOLN(java.lang.String str)
Check whether str contains an End of Line. Both '\n' and '\r' are considered end of line characters.


checked

public static QStr checked(java.lang.String str)

unqualified

public java.lang.String unqualified()

qualities

public int qualities()

isKnownThat

public boolean isKnownThat(int mask)

rememberThat

public void rememberThat(int mask)

isFilenameSecure

public boolean isFilenameSecure()

checkIsFilenameSecure

protected void checkIsFilenameSecure()

hasEOLN

public boolean hasEOLN()

checkHasEOLN

protected void checkHasEOLN()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).