Class JavaExtension


  • public class JavaExtension
    extends java.lang.Object
    Defines a java extension of the template language.
    Author:
    Holger Eichelberger
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaExtension()
      Constructor for serialization.
      JavaExtension​(java.lang.Class<?> extension, TypeRegistry registry)
      Creates a default Java extension instance.
      JavaExtension​(java.lang.String name, TypeRegistry registry)
      Creates a java extension instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object accept​(IVisitor visitor)
      Visits a java extension.
      java.lang.String getName()
      The name of the Java class extending the functionality.
      IMetaType getResolved()
      Returns the resolved type.
      boolean isDefault()
      Returns whether this Java extension is a default extension.
      • Methods inherited from class java.lang.Object

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

      • name

        private java.lang.String name
      • isDefault

        private boolean isDefault
    • Constructor Detail

      • JavaExtension

        JavaExtension()
        Constructor for serialization.
      • JavaExtension

        public JavaExtension​(java.lang.String name,
                             TypeRegistry registry)
                      throws VilException
        Creates a java extension instance.
        Parameters:
        name - the name of the Java class extending the functionality
        registry - the type registry being responsible for this extension
        Throws:
        VilException - in case that the related class denoted by name cannot be resolved
      • JavaExtension

        public JavaExtension​(java.lang.Class<?> extension,
                             TypeRegistry registry)
                      throws VilException
        Creates a default Java extension instance.
        Parameters:
        extension - the extension class
        registry - the type registry being responsible for this extension
        Throws:
        VilException - in case that the related class denoted by name cannot be resolved
    • Method Detail

      • getResolved

        public IMetaType getResolved()
        Returns the resolved type.
        Returns:
        the resolved type
      • getName

        public java.lang.String getName()
        The name of the Java class extending the functionality.
        Returns:
        the name
      • accept

        public java.lang.Object accept​(IVisitor visitor)
                                throws VilException
        Visits a java extension.
        Parameters:
        visitor - the visitor
        Returns:
        the result of visiting this instance (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • isDefault

        public boolean isDefault()
        Returns whether this Java extension is a default extension.
        Returns:
        true if it is a default extension, false else