Class DefaultNameStrategy

  • All Implemented Interfaces:
    NameStrategy

    public class DefaultNameStrategy
    extends java.lang.Object
    implements NameStrategy
    A NameStrategy 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  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NAME_PATTERN

        private static final java.util.regex.Pattern NAME_PATTERN
      • PACKAGE_PATTERN

        private static final java.util.regex.Pattern PACKAGE_PATTERN
    • Constructor Detail

      • DefaultNameStrategy

        public DefaultNameStrategy()
    • 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 interface NameStrategy
        Parameters:
        script - the Java script
        Returns:
        the fully qualified class name
        Throws:
        javax.script.ScriptException - if no class name could be determined