Class JavaModelUtil
- java.lang.Object
-
- com.devonfw.cobigen.javaplugin.model.JavaModelUtil
-
public class JavaModelUtil extends java.lang.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 java.util.Map<java.lang.String,java.lang.Object>getAnnotations(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model annotations-element (ModelConstant.ANNOTATIONS)static java.lang.StringgetCanonicalName(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model's canonicalName element, which is the full qualified name of the input classstatic java.util.Map<java.lang.String,java.lang.Object>getExtendedType(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model's super type elementstatic java.util.Map<java.lang.String,java.lang.Object>getField(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String fieldName)Returns the field model with the given field name from modelstatic java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getFields(java.util.Map<java.lang.String,java.lang.Object> model)Returns the list of all field models (ModelConstant.FIELDS)static java.util.Map<java.lang.String,java.lang.Object>getImplementedType(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String fqn)Returns the interface model for the given interface name if such an interface exists, otherwise null.static java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getImplementedTypes(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model's implemented types element, which is a list consisting of the interface modelsstatic java.util.Map<java.lang.String,java.lang.Object>getJavaDocModel(java.util.Map<java.lang.String,java.lang.Object> documentedElementModel)Returns the JavaDoc model of the documented element model passed.static java.util.Map<java.lang.String,java.lang.Object>getMethod(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String methodName)Returns the method model of the model with the given methodName.static java.util.Map<java.lang.String,java.lang.Object>getMethodAccessibleField(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String fieldName)Returns the field model with the given field name from modelstatic java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getMethodAccessibleFields(java.util.Map<java.lang.String,java.lang.Object> model)Returns the list of all field models (ModelConstant.METHOD_ACCESSIBLE_FIELDS)static java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getMethods(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model's methods element, which is a list consisting of the method modelsstatic java.lang.StringgetName(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model's name element, which is the simple name of the input classstatic java.util.Map<java.lang.String,java.lang.Object>getRoot(java.util.Map<java.lang.String,java.lang.Object> model)Returns the model root-element (ModelConstant.MODEL_ROOT)
-
-
-
Method Detail
-
getRoot
public static java.util.Map<java.lang.String,java.lang.Object> getRoot(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getAnnotations(java.util.Map<java.lang.String,java.lang.Object> model)
Returns the model annotations-element (ModelConstant.ANNOTATIONS)- Parameters:
model- raw model- Returns:
- the model annotations-element (
ModelConstant.ANNOTATIONS)
-
getFields
public static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getFields(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getField(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.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 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getMethodAccessibleFields(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getMethodAccessibleField(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getExtendedType(java.util.Map<java.lang.String,java.lang.Object> model)
Returns the model's super type element- Parameters:
model- raw model- Returns:
- the model's super type element
-
getImplementedTypes
public static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getImplementedTypes(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getImplementedType(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.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 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getMethods(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getMethod(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.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 java.lang.String getName(java.util.Map<java.lang.String,java.lang.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 java.lang.String getCanonicalName(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getJavaDocModel(java.util.Map<java.lang.String,java.lang.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.
-
-