1 ProcessBuilder
Class Ax.lang.ProcessBuilder
Constructor Summary
Method Summary
Constructor Detail
Ax.lang.ProcessBuilder.JSProcessBuilder
-
Ax.lang.ProcessBuilder.JSProcessBuilder()
- Info:
-
Creates a new process.
new Ax.lang.ProcessBuilder().command("bash", "-c", "ls /home/mkyong/");
Method Detail
Ax.lang.ProcessBuilder.command
-
smallint Ax.lang.ProcessBuilder.command( string[] args )
- Info:
-
Sets the command for the process to execute, executes it, and returns 0 if there has not been any execution error, or !=0 otherwise. - Parameters:
- args - command arguments
- Returns:
- smallint
var status = pb.directory('/tmp').command('/bin/bash', '-c', 'ls -l');
Ax.lang.ProcessBuilder.directory
-
file Ax.lang.ProcessBuilder.directory()
- Info:
-
Returns the directory the process is at. - Returns:
- file
Ax.lang.ProcessBuilder.directory
-
object Ax.lang.ProcessBuilder.directory( file file )
- Info:
-
Sets the directory the process is at. - Parameters:
- file - file denoting the directory
- Returns:
- object
Ax.lang.ProcessBuilder.directory
-
object Ax.lang.ProcessBuilder.directory( string file )
- Info:
-
Sets the directory the process is at. - Parameters:
- file - file denoting the directory
- Returns:
- object
Ax.lang.ProcessBuilder.getStdErr
-
string Ax.lang.ProcessBuilder.getStdErr()
- Info:
-
Returns the std error of the command execution. - Returns:
- string
Ax.lang.ProcessBuilder.getStdOut
-
string Ax.lang.ProcessBuilder.getStdOut()
- Info:
-
Returns the std output of the command execution. - Returns:
- string
Ax.lang.ProcessBuilder.setTimeout
-
object Ax.lang.ProcessBuilder.setTimeout( smallint seconds )
- Info:
-
Sets a timeout for the process, that is, the process will end ofter the defined time. - Parameters:
- seconds - timeout in seconds
- Returns:
- object
2 Exception
Class Ax.lang.Exception
Constructor Summary
Method Summary
Constructor Detail
Ax.lang.Exception.JSException
-
Ax.lang.Exception.JSException( string error_code )
- Info:
-
Creates a new exception with the specified code. - Parameters:
- error_code - the exception code
Ax.lang.Exception.JSException
-
Ax.lang.Exception.JSException( string error_code, string message )
- Info:
-
Creates a new exception with the specified code and message. - Parameters:
- error_code - the exception code
- message - the exception message
throw new Ax.lang.Exception("E001", "Invoice XXX not found");
Method Detail
Ax.lang.Exception.addSuppressed
-
null Ax.lang.Exception.addSuppressed( object arg0 )
- Parameters:
- arg0 -
- Returns:
- null
Ax.lang.Exception.fillInStackTrace
-
object Ax.lang.Exception.fillInStackTrace()
- Returns:
- object
Ax.lang.Exception.getCause
-
object Ax.lang.Exception.getCause()
- Returns:
- object
Ax.lang.Exception.getData
-
object Ax.lang.Exception.getData()
- Info:
-
Returns the exception code. - Returns:
- object
Ax.lang.Exception.getErrorCode
-
string Ax.lang.Exception.getErrorCode()
- Info:
-
Returns the exception code. - Returns:
- string
Ax.lang.Exception.getLocalizedMessage
-
string Ax.lang.Exception.getLocalizedMessage()
- Info:
-
Returns the localized (locale-specific) exception message. - Returns:
- string
Ax.lang.Exception.getLocalizedMessage
-
string Ax.lang.Exception.getLocalizedMessage()
- Returns:
- string
Ax.lang.Exception.getMessage
-
string Ax.lang.Exception.getMessage()
- Info:
-
Returns the exception message, or the code if there is no message. - Returns:
- string
Ax.lang.Exception.getMessage
-
string Ax.lang.Exception.getMessage()
- Returns:
- string
Ax.lang.Exception.getStackTrace
-
object Ax.lang.Exception.getStackTrace()
- Returns:
- object
Ax.lang.Exception.getSuppressed
-
object Ax.lang.Exception.getSuppressed()
- Returns:
- object
Ax.lang.Exception.initCause
-
object Ax.lang.Exception.initCause( object arg0 )
- Parameters:
- arg0 -
- Returns:
- object
Ax.lang.Exception.printStackTrace
-
null Ax.lang.Exception.printStackTrace()
- Returns:
- null
Ax.lang.Exception.printStackTrace
-
null Ax.lang.Exception.printStackTrace( object arg0 )
- Parameters:
- arg0 -
- Returns:
- null
Ax.lang.Exception.printStackTrace
-
null Ax.lang.Exception.printStackTrace( object arg0 )
- Parameters:
- arg0 -
- Returns:
- null
Ax.lang.Exception.setCause
-
null Ax.lang.Exception.setCause( object arg0 )
- Parameters:
- arg0 -
- Returns:
- null
Ax.lang.Exception.setData
-
object Ax.lang.Exception.setData( object data )
- Parameters:
- data -
- Returns:
- object
Ax.lang.Exception.setErrorCode
-
object Ax.lang.Exception.setErrorCode( string error_code )
- Parameters:
- error_code -
- Returns:
- object
Ax.lang.Exception.setStackTrace
-
null Ax.lang.Exception.setStackTrace( object arg0 )
- Parameters:
- arg0 -
- Returns:
- null
Ax.lang.Exception.toString
-
string Ax.lang.Exception.toString()
- Returns:
- string
3 String
Class Ax.lang.String
Constructor Summary
Method Summary
Constructor Detail
Ax.lang.String.JSString
-
Ax.lang.String.JSString( string object )
- Info:
-
Creates a new instance from a String. - Parameters:
- object - source String
Ax.lang.String.JSString
-
Ax.lang.String.JSString( byte[] object )
- Info:
-
Creates a new instance from a byte array. - Parameters:
- object - source byte array
Ax.lang.String.JSString
-
Ax.lang.String.JSString( byte[] object, string encoding )
- Info:
-
Creates a new instance from a byte array. - Parameters:
- object - source byte array
- encoding - encoding to use
Method Detail
Ax.lang.String.charAt
-
object Ax.lang.String.charAt( smallint index )
- Info:
-
Returns the char value at the specified index. - Parameters:
- index - the index of the char value
- Returns:
- object
Ax.lang.String.chars
-
object Ax.lang.String.chars()
- Returns:
- object
Ax.lang.String.codePoints
-
object Ax.lang.String.codePoints()
- Returns:
- object
Ax.lang.String.compare
-
smallint Ax.lang.String.compare( string arg0, string arg1 )
- Parameters:
- arg0 -
- arg1 -
- Returns:
- smallint
Ax.lang.String.decodeXML
-
object Ax.lang.String.decodeXML()
- Info:
-
Decode the XML escaped entities - Returns:
- object
Ax.lang.String.encodeXML
-
object Ax.lang.String.encodeXML()
- Info:
-
Encodes the string for XML processing - Returns:
- object
Ax.lang.String.equals
-
boolean Ax.lang.String.equals( object obj )
- Info:
-
Compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object. - Parameters:
- obj - the object to compare this {@code String} against
- Returns:
- boolean
Ax.lang.String.format
-
object Ax.lang.String.format( object[] args )
- Info:
-
Formats the string with the given args. - Parameters:
- args - parameters for the string formatting
- Returns:
- object
var s = new Ax.lang.String('%s = %d').format('joe', 35);
Ax.lang.String.format
-
object Ax.lang.String.format( string s, object[] args )
- Info:
-
Formats the string with the given args. As it's static it can not decode the object[] of args using the engine! so we can not properly decode Nashorn/Graal native objects. - Parameters:
- s - string to format
- args - parameters for the string formatting
- Returns:
- object
var s = Ax.lang.String.format("%s = %d", "joe", 35);
Ax.lang.String.getBytes
-
byte[] Ax.lang.String.getBytes( string charsetName )
- Info:
-
Encodes this - Parameters:
- charsetName - encoding charset: US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16
- Returns:
- byte[]
Ax.lang.String.hashCode
-
smallint Ax.lang.String.hashCode()
- Info:
-
Returns a hash code for this string. The hash code for a String object is computed as - Returns:
- smallint
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
i
Ax.lang.String.isBlank
-
boolean Ax.lang.String.isBlank()
- Info:
-
Returns true if the string is empty or contains only white space codepoints, otherwise false. - Returns:
- boolean
Ax.lang.String.isEmpty
-
boolean Ax.lang.String.isEmpty()
- Info:
-
Returns true if, and only if, length() is 0. - Returns:
- boolean
Ax.lang.String.length
-
smallint Ax.lang.String.length()
- Info:
-
Returns the length of the sequence of characters represented by this string - Returns:
- smallint
Ax.lang.String.lpad
-
object Ax.lang.String.lpad( object c, smallint length )
- Info:
-
Adds the character c to the left of the string until the string has the specified length. - Parameters:
- c - character to add
- length - length to achieve
- Returns:
- object
Ax.lang.String.ltrim
-
object Ax.lang.String.ltrim()
- Info:
-
Deletes the spaces on the left of the string. - Returns:
- object
Ax.lang.String.ltrim
-
string Ax.lang.String.ltrim( string s )
- Info:
-
Deletes the spaces on the left of the string. - Parameters:
- s - string to trim
- Returns:
- string
Ax.lang.String.mask
-
object Ax.lang.String.mask( string mask )
- Info:
-
Masks the string with the provided mask - Parameters:
- mask - mask to apply
- Returns:
- object
Ax.lang.String.replace
-
object Ax.lang.String.replace( string target, string replacement )
- Info:
-
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab". - Parameters:
- target - the sequence of char values to be replaced
- replacement - the replacement sequence of char values
- Returns:
- object
Ax.lang.String.replaceAll
-
object Ax.lang.String.replaceAll( string regex, string replacement )
- Info:
-
Replaces all the string subsequences defined by the regex with the specified replacement. - Parameters:
- regex - regular expression to define subsequences
- replacement - replacement for the string subsequences
- Returns:
- object
Ax.lang.String.rpad
-
object Ax.lang.String.rpad( object c, smallint length )
- Info:
-
Adds the character c to the right of the string until the string has the specified length. - Parameters:
- c - character to add
- length - length to achieve
- Returns:
- object
Ax.lang.String.rtrim
-
object Ax.lang.String.rtrim()
- Info:
-
Deletes the spaces on the right of the string. - Returns:
- object
Ax.lang.String.rtrim
-
string Ax.lang.String.rtrim( string s )
- Info:
-
Deletes the spaces on the right of the string. - Parameters:
- s - string to trim
- Returns:
- string
Ax.lang.String.subSequence
-
string Ax.lang.String.subSequence( smallint start, smallint end )
- Info:
-
Returns a character sequence that is a subsequence of this sequence. - Parameters:
- start - the begin index, inclusive
- end - the end index, exclusive
- Returns:
- string
Ax.lang.String.toString
-
string Ax.lang.String.toString()
- Info:
-
Mimics String, that is, returns a String from the JSString. - Returns:
- string
Ax.lang.String.trim
-
object Ax.lang.String.trim()
- Info:
-
Deletes the spaces on the left and right of the string. - Returns:
- object
Ax.lang.String.wrap
-
object Ax.lang.String.wrap( smallint wrapLength )
- Info:
-
Wraps the string with the specified length, that is, separates the string in subsequences of wrapLength, adding a newline between them. It does not separate words: - Parameters:
- wrapLength - line length
- Returns:
- object
"Here is one line of text that is going to be wrapped after 20 columns."
"Here is one line of\ntext that is going\nto be wrapped after\n20 columns."
Ax.lang.String.wrap
-
object Ax.lang.String.wrap( smallint wrapLength, string newLineStr )
- Info:
-
Wraps the string with the specified length, that is, separates the string in subsequences of wrapLength, adding newLineStr between them. It does not separate words: - Parameters:
- wrapLength - line length
- newLineStr - the string to insert for a new line
- Returns:
- object
"Here is one line of text that is going to be wrapped after 20 columns."
"Here is one line of" + newLineStr + "text that is going" + newLineStr + "to be wrapped after" + newLineStr + "20 columns."
4 StringBuilder
Class Ax.lang.StringBuilder
Constructor Summary
Method Summary
Constructor Detail
Ax.lang.StringBuilder.JSStringBuilder
-
Ax.lang.StringBuilder.JSStringBuilder()
- Info:
-
Instantiates a new Js string builder.
Ax.lang.StringBuilder.JSStringBuilder
-
Ax.lang.StringBuilder.JSStringBuilder( smallint capacity )
- Info:
-
Instantiates a new Js string builder. - Parameters:
- capacity - the capacity
Ax.lang.StringBuilder.JSStringBuilder
-
Ax.lang.StringBuilder.JSStringBuilder( string str )
- Info:
-
Instantiates a new Js string builder. - Parameters:
- str - the str
Method Detail
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( object obj )
- Info:
-
Append js string builder. - Parameters:
- obj - the obj
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( string str )
- Parameters:
- str -
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( boolean b )
- Info:
-
Append js string builder. - Parameters:
- b - the b
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( smallint i )
- Info:
-
Append js string builder. - Parameters:
- i - the
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( long lng )
- Info:
-
Append js string builder. - Parameters:
- lng - the lng
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( object f )
- Info:
-
Append js string builder. - Parameters:
- f - the f
- Returns:
- object
Ax.lang.StringBuilder.append
-
object Ax.lang.StringBuilder.append( double d )
- Info:
-
Append js string builder. - Parameters:
- d - the d
- Returns:
- object
Ax.lang.StringBuilder.toString
-
string Ax.lang.StringBuilder.toString()
- Returns:
- string
5 System
Class Ax.lang.System
Method Summary
Method Detail
Ax.lang.System.getBooleanProperty
-
static boolean Ax.lang.System.getBooleanProperty( string key, boolean _default )
- Info:
-
Gets the system property indicated by the specified key. The _defaut is returned if property doesn't exist. - Parameters:
- key - key to identify system property
- _default - default value
- Returns:
- boolean
Ax.lang.System.getEnv
-
static object Ax.lang.System.getEnv()
- Info:
-
Returns an unmodifiable string map view of the current system environment. - Returns:
- object
Ax.lang.System.getEnv
-
static string Ax.lang.System.getEnv( string key )
- Info:
-
Gets the value of the specified environment variable - Parameters:
- key - environment variable name, like "HOME"
- Returns:
- string
Ax.lang.System.getFileSeparator
-
static string Ax.lang.System.getFileSeparator()
- Info:
-
Returns the system-dependent default name-separator character, represented as a string. - Returns:
- string
Ax.lang.System.getIntProperty
-
static smallint Ax.lang.System.getIntProperty( string key, smallint _default )
- Info:
-
Gets the system property indicated by the specified key. The _defaut is returned if property doesn't exist. - Parameters:
- key - key to identify system property
- _default - default value
- Returns:
- smallint
Ax.lang.System.getProperty
-
static string Ax.lang.System.getProperty( string key )
- Info:
-
Gets the system property indicated by the specified key. - Parameters:
- key - key to identify system property
- Returns:
- string
Ax.lang.System.getProperty
-
static string Ax.lang.System.getProperty( string key, string _default )
- Info:
-
Gets the system property indicated by the specified key. The _defaut is returned if property doesn't exist. - Parameters:
- key - key to identify system property
- _default - default value
- Returns:
- string
Ax.lang.System.isBatch
-
static boolean Ax.lang.System.isBatch()
- Info:
-
Returns whether the script is run in batch mode. - Returns:
- boolean
Ax.lang.System.sleep
-
static null Ax.lang.System.sleep( long millis )
- Info:
-
Causes the currently executing thread to sleep for the specified number of milliseconds - Parameters:
- millis - milliseconds to sleep
- Returns:
- null
6 Types
Class Ax.lang.Types
Method Summary
Method Detail
Ax.lang.Types.toJavascript
-
static object Ax.lang.Types.toJavascript( object src )
- Info:
-
Convert an object to a javascript object. The input can be either a javascript native object or a java object. - Parameters:
- src - source java object
- Returns:
- object
let fileList = new Ax.io.File("/tmp").list(); let jsArray = Ax.lang.Types.toJavascript(fileList) // sort is a method in native js arrays jsArray.sort();
push
slice
filter