Class MethodLocation

  • All Implemented Interfaces:
    java.lang.Comparable<SortableLocation>, SortableLocation

    public class MethodLocation
    extends FieldLocation
    Comparable path structure to locate a particular method within compilation unit.
    Since:
    2.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NO_PARAMETERS
      Signature for a method without any parameters.
      static java.lang.String PARAMETER_SEPARATOR
      Separator for a method's parameters.
      private java.lang.String parameters  
    • Constructor Summary

      Constructors 
      Constructor Description
      MethodLocation​(java.lang.String packageName, java.lang.String className, java.lang.String classXmlName, java.lang.String memberName, java.lang.String memberXmlName, java.util.List<com.thoughtworks.qdox.model.JavaParameter> parameters)
      Creates a new MethodLocation with the supplied package, class and member names.
    • Field Detail

      • NO_PARAMETERS

        public static final java.lang.String NO_PARAMETERS
        Signature for a method without any parameters.
        See Also:
        Constant Field Values
      • PARAMETER_SEPARATOR

        public static final java.lang.String PARAMETER_SEPARATOR
        Separator for a method's parameters.
        See Also:
        Constant Field Values
      • parameters

        private java.lang.String parameters
    • Constructor Detail

      • MethodLocation

        public MethodLocation​(java.lang.String packageName,
                              java.lang.String className,
                              java.lang.String classXmlName,
                              java.lang.String memberName,
                              java.lang.String memberXmlName,
                              java.util.List<com.thoughtworks.qdox.model.JavaParameter> parameters)
        Creates a new MethodLocation with the supplied package, class and member names.
        Parameters:
        packageName - The name of the package for a class potentially holding JavaDoc. Cannot be null.
        className - The (simple) name of a class. Cannot be null or empty.
        classXmlName - The name given as the XmlType.name() value of an annotation placed on the Class, or null if none is provided.
        memberName - The name of a (method or) field. Cannot be null or empty.
        memberXmlName - The name given as the XmlElement.name() or XmlAttribute.name() value of an annotation placed on this Field, or null if none is provided.
        parameters - The names of the types which are parameters to this method.
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Always appends the effective className to the path from the superclass PackageLocation. If the ClassLocation.getAnnotationRenamedTo() method returns a non-null value, that value is the effective className. Otherwise, the ClassLocation.getClassName() method is used as the effective className. This is to handle renames such as provided in a XmlType annotation's XmlType.name() attribute value.
        Specified by:
        getPath in interface SortableLocation
        Overrides:
        getPath in class FieldLocation
        Returns:
        the path of the PackageLocation superclass, appended with the effective className.
        See Also:
        XmlType, XmlAttribute.name(), XmlElement.name()
      • getParametersAsString

        public java.lang.String getParametersAsString()
        Returns:
        The parameters, concatenated into a String.
      • hasNoParameters

        public boolean hasNoParameters()
        Returns:
        True if this MethodLocation has no parameters.