java.lang.Object
org.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".
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
QStr
public QStr(java.lang.String str)
QStr
public QStr(java.lang.String str,
int qualities)
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()).