Class JavaModelUtil
- java.lang.Object
-
- com.devonfw.cobigen.javaplugin.model.JavaModelUtil
-
public class JavaModelUtil extends Object
* TheJavaModelUtilclass provides helper functions to access the given model.- Author:
- fkreis (25.09.2014)
-
-
Constructor Summary
Constructors Constructor Description JavaModelUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>getAnnotations(Map<String,Object> model)Returns the model annotations-element (ModelConstant.ANNOTATIONS)static StringgetCanonicalName(Map<String,Object> model)Returns the model's canonicalName element, which is the full qualified name of the input classstatic Map<String,Object>getExtendedType(Map<String,Object> model)Returns the model's super type elementstatic Map<String,Object>getField(Map<String,Object> model, String fieldName)Returns the field model with the given field name from modelstatic List<Map<String,Object>>getFields(Map<String,Object> model)Returns the list of all field models (ModelConstant.FIELDS)static Map<String,Object>getImplementedType(Map<String,Object> model, String fqn)Returns the interface model for the given interface name if such an interface exists, otherwise null.static List<Map<String,Object>>getImplementedTypes(Map<String,Object> model)Returns the model's implemented types element, which is a list consisting of the interface modelsstatic Map<String,Object>getJavaDocModel(Map<String,Object> documentedElementModel)Returns the JavaDoc model of the documented element model passed.static Map<String,Object>getMethod(Map<String,Object> model, String methodName)Returns the method model of the model with the given methodName.static Map<String,Object>getMethodAccessibleField(Map<String,Object> model, String fieldName)Returns the field model with the given field name from modelstatic List<Map<String,Object>>getMethodAccessibleFields(Map<String,Object> model)Returns the list of all field models (ModelConstant.METHOD_ACCESSIBLE_FIELDS)static List<Map<String,Object>>getMethods(Map<String,Object> model)Returns the model's methods element, which is a list consisting of the method modelsstatic StringgetName(Map<String,Object> model)Returns the model's name element, which is the simple name of the input classstatic Map<String,Object>getRoot(Map<String,Object> model)Returns the model root-element (ModelConstant.MODEL_ROOT)
-
-
-
Method Detail
-
getRoot
public static Map<String,Object> getRoot(Map<String,Object> model)
Returns the model root-element (ModelConstant.MODEL_ROOT)- Parameters:
model- raw model- Returns:
- the model root-element (
ModelConstant.MODEL_ROOT)
-
getAnnotations
public static Map<String,Object> getAnnotations(Map<String,Object> model)
Returns the model annotations-element (ModelConstant.ANNOTATIONS)- Parameters:
model- raw model- Returns:
- the model annotations-element (
ModelConstant.ANNOTATIONS)
-
getFields
public static List<Map<String,Object>> getFields(Map<String,Object> model)
Returns the list of all field models (ModelConstant.FIELDS)- Parameters:
model- raw model- Returns:
- the list of all field models
-
getField
public static Map<String,Object> getField(Map<String,Object> model, String fieldName)
Returns the field model with the given field name from model- Parameters:
model- raw modelfieldName- field name to be retrieved- Returns:
- the field model for the given field name if such a field exists, otherwise null.
-
getMethodAccessibleFields
public static List<Map<String,Object>> getMethodAccessibleFields(Map<String,Object> model)
Returns the list of all field models (ModelConstant.METHOD_ACCESSIBLE_FIELDS)- Parameters:
model- raw model- Returns:
- the list of all field models
-
getMethodAccessibleField
public static Map<String,Object> getMethodAccessibleField(Map<String,Object> model, String fieldName)
Returns the field model with the given field name from model- Parameters:
model- raw modelfieldName- field name to be retrieved- Returns:
- the field model for the given field name if such a field exists, otherwise null.
-
getExtendedType
public static Map<String,Object> getExtendedType(Map<String,Object> model)
Returns the model's super type element- Parameters:
model- raw model- Returns:
- the model's super type element
-
getImplementedTypes
public static List<Map<String,Object>> getImplementedTypes(Map<String,Object> model)
Returns the model's implemented types element, which is a list consisting of the interface models- Parameters:
model- raw model- Returns:
- the model's interfaces element
-
getImplementedType
public static Map<String,Object> getImplementedType(Map<String,Object> model, String fqn)
Returns the interface model for the given interface name if such an interface exists, otherwise null.- Parameters:
model- raw modelfqn- full qualified name, which identifies the specific interface- Returns:
- the interface model
-
getMethods
public static List<Map<String,Object>> getMethods(Map<String,Object> model)
Returns the model's methods element, which is a list consisting of the method models- Parameters:
model- raw model- Returns:
- the model's methods element
-
getMethod
public static Map<String,Object> getMethod(Map<String,Object> model, String methodName)
Returns the method model of the model with the given methodName.- Parameters:
model- raw modelmethodName- method name to search for- Returns:
- method model for the method with the given name or
nullif no method with the given name found.
-
getName
public static String getName(Map<String,Object> model)
Returns the model's name element, which is the simple name of the input class- Parameters:
model- raw model- Returns:
- the model's name element
-
getCanonicalName
public static String getCanonicalName(Map<String,Object> model)
Returns the model's canonicalName element, which is the full qualified name of the input class- Parameters:
model- raw model- Returns:
- the model's canonicalName element
-
getJavaDocModel
public static Map<String,Object> getJavaDocModel(Map<String,Object> documentedElementModel)
Returns the JavaDoc model of the documented element model passed.- Parameters:
documentedElementModel- element model, from which the javaDoc model should be retrieved.- Returns:
- the JavaDoc model or
nullif not available.
-
-