Class JavaModelUtil


  • public class JavaModelUtil
    extends Object
    * The JavaModelUtil class provides helper functions to access the given model.
    Author:
    fkreis (25.09.2014)
    • Constructor Detail

      • JavaModelUtil

        public JavaModelUtil()
    • Method Detail

      • 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 model
        fieldName - field name to be retrieved
        Returns:
        the field model for the given field name if such a field exists, otherwise null.
      • 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 model
        fieldName - 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 model
        fqn - 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 model
        methodName - method name to search for
        Returns:
        method model for the method with the given name or null if 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 null if not available.