Class DefaultNameStrategy
- java.lang.Object
-
- ch.obermuhlner.scriptengine.java.name.DefaultNameStrategy
-
- All Implemented Interfaces:
NameStrategy
public class DefaultNameStrategy extends java.lang.Object implements NameStrategy
ANameStrategy
that scans the Java script to determine the package name and class name defined in the script.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
NAME_PATTERN
private static java.util.regex.Pattern
PACKAGE_PATTERN
-
Constructor Summary
Constructors Constructor Description DefaultNameStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFullName(java.lang.String script)
Returns the fully qualified name of the Java class in the specified script.
-
-
-
Method Detail
-
getFullName
public java.lang.String getFullName(java.lang.String script) throws javax.script.ScriptException
Description copied from interface:NameStrategy
Returns the fully qualified name of the Java class in the specified script.- Specified by:
getFullName
in interfaceNameStrategy
- Parameters:
script
- the Java script- Returns:
- the fully qualified class name
- Throws:
javax.script.ScriptException
- if no class name could be determined
-
-