Class PackageLocation
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.PackageLocation
-
- All Implemented Interfaces:
Comparable<SortableLocation>
,SortableLocation
- Direct Known Subclasses:
ClassLocation
public class PackageLocation extends Object implements SortableLocation
Comparable path structure to locate a particular package within compilation unit.- Since:
- 2.0
- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Constructor Summary
Constructors Constructor Description PackageLocation(String packageName)
Creates a new PackageLocation with the supplied package name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SortableLocation that)
Compares the string representations of this PackageLocation and the supplied SortableLocation.boolean
equals(Object obj)
String
getAnnotationRenamedTo()
Note: Packages cannot be renamed from a JAXB annotation.String
getPackageName()
Retrieves the name of the package potentially holding JavaDoc.String
getPath()
Retrieves the path of this SortableLocation.int
hashCode()
boolean
isEqualToPath(String path)
Validates if the supplied path is equal to this SortableLocation.String
toString()
-
-
-
Constructor Detail
-
PackageLocation
public PackageLocation(String packageName)
Creates a new PackageLocation with the supplied package name.- Parameters:
packageName
- The name of the package potentially holding JavaDoc. Cannot benull
.
-
-
Method Detail
-
getPackageName
public String getPackageName()
Retrieves the name of the package potentially holding JavaDoc.- Returns:
- The name of the package potentially holding JavaDoc. Can be empty, but never
null
.
-
getAnnotationRenamedTo
public String getAnnotationRenamedTo()
Note: Packages cannot be renamed from a JAXB annotation. Retrieves the value of the name attribute provided by a JAXB annotation, implying that the XSD type should use another name than the default.- Specified by:
getAnnotationRenamedTo
in interfaceSortableLocation
- Returns:
- the value of the name attribute provided by a JAXB annotation relevant to this
SortableLocation
. - See Also:
XmlElement.name()
,XmlAttribute.name()
,XmlType.name()
-
getPath
public String getPath()
Retrieves the path of this SortableLocation. The path must uniquely correspond to each unique SortableLocation, implying that SortableLocations could be sorted and compared for equality using the path property.- Specified by:
getPath
in interfaceSortableLocation
- Returns:
- the path of this SortableLocation. Never null.
-
isEqualToPath
public boolean isEqualToPath(String path)
Validates if the supplied path is equal to this SortableLocation.- Specified by:
isEqualToPath
in interfaceSortableLocation
- Parameters:
path
- The non-null path to compare to this SortableLocation.- Returns:
true
if this SortableLocation is equal to the supplied path.
-
compareTo
public int compareTo(SortableLocation that)
Compares the string representations of this PackageLocation and the supplied SortableLocation.
- Specified by:
compareTo
in interfaceComparable<SortableLocation>
-
-