Class EnumGenerator

java.lang.Object
org.opendaylight.yangtools.binding.codegen.EnumGenerator
All Implemented Interfaces:
CodeGenerator

public class EnumGenerator extends Object implements CodeGenerator
Transformator of the data from the virtual form to JAVA source code. The result source code represents JAVA enumeration. For generation of the source code is used the template written in XTEND language.
  • Constructor Details

    • EnumGenerator

      public EnumGenerator()
  • Method Details

    • isAcceptable

      public boolean isAcceptable(Type type)
      Description copied from interface: CodeGenerator
      Checks if the concrete instance of type fit to concrete implementation of this interface (e.g. method return true if in EnumGenerator (which implements this interface) has input parameter of type Enumeration (which is subtype of Type).
      Specified by:
      isAcceptable in interface CodeGenerator
      Parameters:
      type - Input type to be processed
      Returns:
      true if type is acceptable for processing.
    • generate

      public String generate(Type type)
      Generates JAVA source code for generated type Type. The code is generated according to the template source code template which is written in XTEND language.
      Specified by:
      generate in interface CodeGenerator
      Parameters:
      type - Input type to be processed
      Returns:
      generated JAVA code
    • getUnitName

      public String getUnitName(Type type)
      Description copied from interface: CodeGenerator
      Returns name of type parameter.
      Specified by:
      getUnitName in interface CodeGenerator
      Parameters:
      type - Input type to be processed
      Returns:
      name of generated unit