- 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 String
getFormatVersion()
Returns the format version as aString
.static InputStream
getLangSpecSchema()
Returns an input stream from which the langspec schema can be read.static boolean
isIdentifier(CharSequence name)
Returns whethername
is a valid identifier.static String
requireIdentifier(CharSequence name)
Checks thatname
is a valid identifier.
-
-
-
Method Detail
-
isIdentifier
public static boolean isIdentifier(CharSequence name)
Returns whethername
is a valid identifier.- Parameters:
name
- theCharSequence
to check- Returns:
- whether
name
is a valid identifier - Throws:
NullPointerException
- ifname
isnull
- Since:
- 1.0.0
-
requireIdentifier
public static String requireIdentifier(CharSequence name)
Checks thatname
is a valid identifier.- Parameters:
name
- theCharSequence
to check- Returns:
name
as aString
- Throws:
NullPointerException
- ifname
isnull
IllegalArgumentException
- ifname
is 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
-
-