Class ClassBuilderInfo
java.lang.Object
org.freedesktop.dbus.utils.generator.ClassBuilderInfo
Helper to create Java class/interface files with proper formatting.
- Since:
- v3.0.1 - 2018-12-22
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains information about annotation to place on classes, members or methods.static classPojo which represents a class constructor.static classPojo which represents a class method.static enumEnum to define either theClassBuilderInfois for a CLASS or an INTERFACE.static classPojo which represents a class member/field or argument. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ClassBuilderInfo.AnnotationInfo> Annotations of this class.private StringName of this class.private ClassBuilderInfo.ClassTypeType of this class (interface or class).private final List<ClassBuilderInfo.ClassConstructor> Constructors for this class.private StringPackage name used by DBus.private StringClass which this class may extend.Interfaces implemented by this class.Imported files for this class.private final List<ClassBuilderInfo> Inner classes inside of this class.private final List<ClassBuilderInfo.MemberOrArgument> Members/Fields of this class.private final List<ClassBuilderInfo.ClassMethod> Methods provided by this class.private StringPackage of this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate the Java source for the class information provided.createClassFileContent(boolean _staticClass, Set<String> _otherImports) Create the Java source for the class information provided.(package private) static StringgetClassName(String _fqcn) Extract the class name from a given FQCN (fully qualified classname).Create the filename with path this java class should use.getFqcn()Creates the fully qualified classname based on the provided classname and package.getImportsForType(String _type) Get all classes that should be imported for the input type, this method works fine with generic types.(package private) static StringgetSimpleTypeClasses(String _type) Simplify class names in the type.voidsetClassName(String _className) voidsetClassType(ClassBuilderInfo.ClassType _classType) voidsetDbusPackageName(String _dbusPackageName) voidsetExtendClass(String _extendClass) voidsetPackageName(String _packageName) toString()
-
Field Details
-
imports
Imported files for this class. -
annotations
Annotations of this class. -
members
Members/Fields of this class. -
implementedInterfaces
Interfaces implemented by this class. -
methods
Methods provided by this class. -
innerClasses
Inner classes inside of this class. -
constructors
Constructors for this class. -
className
Name of this class. -
packageName
Package of this class. -
dbusPackageName
Package name used by DBus. -
classType
Type of this class (interface or class). -
extendClass
Class which this class may extend.
-
-
Constructor Details
-
ClassBuilderInfo
public ClassBuilderInfo()
-
-
Method Details
-
getImports
-
getPackageName
-
setPackageName
-
getDbusPackageName
-
setDbusPackageName
-
getClassName
-
setClassName
-
getClassType
-
setClassType
-
getAnnotations
-
getImplementedInterfaces
-
getExtendClass
-
setExtendClass
-
getMethods
-
getMembers
-
getInnerClasses
-
getConstructors
-
createClassFileContent
Create the Java source for the class information provided.- Returns:
- String
-
createClassFileContent
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
Create the filename with path this java class should use.- Returns:
- String, null if class name was null
-
getFqcn
Creates the fully qualified classname based on the provided classname and package.- Returns:
- String
-
toString
-
getClassName
Extract the class name from a given FQCN (fully qualified classname).- Parameters:
_fqcn- fqcn to analyze- Returns:
- classname, null if input was null
-
getSimpleTypeClasses
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
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
-