- java.lang.Object
-
- org.mal_lang.langspec.Utils
-
public final class Utils extends Object
Utility class containing static helper functions.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFormatVersion()Returns the format version as aString.static InputStreamgetLangSpecSchema()Returns an input stream from which the langspec schema can be read.static booleanisIdentifier(CharSequence name)Returns whethernameis a valid identifier.static StringrequireIdentifier(CharSequence name)Checks thatnameis a valid identifier.
-
-
-
Method Detail
-
isIdentifier
public static boolean isIdentifier(CharSequence name)
Returns whethernameis a valid identifier.- Parameters:
name- theCharSequenceto check- Returns:
- whether
nameis a valid identifier - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
requireIdentifier
public static String requireIdentifier(CharSequence name)
Checks thatnameis a valid identifier.- Parameters:
name- theCharSequenceto check- Returns:
nameas aString- Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not a valid identifier- Since:
- 1.0.0
-
getLangSpecSchema
public static InputStream getLangSpecSchema()
Returns an input stream from which the langspec schema can be read.- Returns:
- an input stream from which the langspec schema can be read
- Since:
- 1.0.0
-
-