Package com.networknt.schema.regex
Class GraalJSRegularExpressionFactory
- java.lang.Object
-
- com.networknt.schema.regex.GraalJSRegularExpressionFactory
-
- All Implemented Interfaces:
RegularExpressionFactory
public class GraalJSRegularExpressionFactory extends Object implements RegularExpressionFactory
GraalJSRegularExpressionFactory.This requires a dependency on org.graalvm.js:js which along with its dependency libraries are 50 MB.
-
-
Constructor Summary
Constructors Constructor Description GraalJSRegularExpressionFactory()Constructor.GraalJSRegularExpressionFactory(org.graalvm.polyglot.Context context)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraalJSRegularExpressionFactorygetInstance()RegularExpressiongetRegularExpression(String regex)Gets aRegularExpression.
-
-
-
Constructor Detail
-
GraalJSRegularExpressionFactory
public GraalJSRegularExpressionFactory()
Constructor.This uses the context from
GraalJSContextFactory.getInstance().It is the caller's responsibility to release the context when it is no longer required by using GraalJSContextFactory.getInstance().close().
-
GraalJSRegularExpressionFactory
public GraalJSRegularExpressionFactory(org.graalvm.polyglot.Context context)
Constructor.It is the caller's responsibility to release the context when it is no longer required.
- Parameters:
context- the context
-
-
Method Detail
-
getInstance
public static GraalJSRegularExpressionFactory getInstance()
-
getRegularExpression
public RegularExpression getRegularExpression(String regex)
Description copied from interface:RegularExpressionFactoryGets aRegularExpression.- Specified by:
getRegularExpressionin interfaceRegularExpressionFactory- Parameters:
regex- the regular expression text value- Returns:
- the regular expression
-
-