Class ClassBuilderInfo

java.lang.Object
org.freedesktop.dbus.utils.generator.ClassBuilderInfo

public class ClassBuilderInfo extends Object
Helper to create Java class/interface files with proper formatting.
Since:
v3.0.1 - 2018-12-22
  • Field Details

  • Constructor Details

    • ClassBuilderInfo

      public ClassBuilderInfo()
  • Method Details

    • getImports

      public Set<String> getImports()
    • getPackageName

      public String getPackageName()
    • setPackageName

      public void setPackageName(String _packageName)
    • getDbusPackageName

      public String getDbusPackageName()
    • setDbusPackageName

      public void setDbusPackageName(String _dbusPackageName)
    • getClassName

      public String getClassName()
    • setClassName

      public void setClassName(String _className)
    • getClassType

      public ClassBuilderInfo.ClassType getClassType()
    • setClassType

      public void setClassType(ClassBuilderInfo.ClassType _classType)
    • getAnnotations

      public List<ClassBuilderInfo.AnnotationInfo> getAnnotations()
    • getImplementedInterfaces

      public Set<String> getImplementedInterfaces()
    • getExtendClass

      public String getExtendClass()
    • setExtendClass

      public void setExtendClass(String _extendClass)
    • getMethods

      public List<ClassBuilderInfo.ClassMethod> getMethods()
    • getMembers

    • getInnerClasses

      public List<ClassBuilderInfo> getInnerClasses()
    • getConstructors

      public List<ClassBuilderInfo.ClassConstructor> getConstructors()
    • createClassFileContent

      public String createClassFileContent()
      Create the Java source for the class information provided.
      Returns:
      String
    • createClassFileContent

      private List<String> createClassFileContent(boolean _staticClass, Set<String> _otherImports)
      Create the Java source for the class information provided.
      Parameters:
      _staticClass - this is static inner class
      _otherImports - this class needs additional imports (e.g. due to inner class)
      Returns:
    • getFileName

      public String getFileName()
      Create the filename with path this java class should use.
      Returns:
      String, null if class name was null
    • getFqcn

      public String getFqcn()
      Creates the fully qualified classname based on the provided classname and package.
      Returns:
      String
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getClassName

      static String getClassName(String _fqcn)
      Extract the class name from a given FQCN (fully qualified classname).
      Parameters:
      _fqcn - fqcn to analyze
      Returns:
      classname, null if input was null
    • getSimpleTypeClasses

      static String getSimpleTypeClasses(String _type)
      Simplify class names in the type. Please go to unit tests for usage examples.
      Parameters:
      _type - type described in the string format
      Returns:
      type with simplified class names
    • getImportsForType

      static Set<String> getImportsForType(String _type)
      Get all classes that should be imported for the input type, this method works fine with generic types. Please go to unit tests for usage examples.
      Parameters:
      _type - type described in the string format
      Returns:
      set of classes required for imports