Class ClassLocation
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.PackageLocation
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.ClassLocation
-
- All Implemented Interfaces:
Comparable<SortableLocation>
,SortableLocation
- Direct Known Subclasses:
FieldLocation
public class ClassLocation extends PackageLocation
Comparable path structure to locate a particular class within compilation unit.- Since:
- 2.0
- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Constructor Summary
Constructors Constructor Description ClassLocation(String packageName, String className, String classXmlName)
Creates a new ClassLocation with the supplied package and class names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAnnotationRenamedTo()
Note: Packages cannot be renamed from a JAXB annotation.String
getClassName()
Retrieves the simple class name for the class potentially holding JavaDoc.String
getPath()
Always appends the effective className to the path from the superclassPackageLocation
.int
hashCode()
String
toString()
-
Methods inherited from class org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.PackageLocation
compareTo, equals, getPackageName, isEqualToPath
-
-
-
-
Constructor Detail
-
ClassLocation
public ClassLocation(String packageName, String className, String classXmlName)
Creates a new ClassLocation with the supplied package and class names.- Parameters:
packageName
- The name of the package for a class potentially holding JavaDoc. Cannot benull
.classXmlName
- The name given as theXmlType.name()
value of an annotation placed on the Class, ornull
if none is provided.className
- The (simple) name of a class. Cannot be null or empty.
-
-
Method Detail
-
getClassName
public String getClassName()
Retrieves the simple class name for the class potentially holding JavaDoc. Nevernull
or empty.- Returns:
- The simple class name for the class potentially holding JavaDoc. Never
null
or empty.
-
getPath
public String getPath()
Always appends the effective className to the path from the superclassPackageLocation
. If thegetAnnotationRenamedTo()
method returns a non-null value, that value is the effective className. Otherwise, thegetClassName()
method is used as the effective className. This is to handle renames such as provided in aXmlType
annotation'sXmlType.name()
attribute value.- Specified by:
getPath
in interfaceSortableLocation
- Overrides:
getPath
in classPackageLocation
- Returns:
- the path of the PackageLocation superclass, appended with the effective className.
- See Also:
XmlType
,XmlAttribute.name()
,XmlElement.name()
-
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
- Overrides:
getAnnotationRenamedTo
in classPackageLocation
- Returns:
- the value of the name attribute provided by a JAXB annotation relevant to this
SortableLocation
. - See Also:
XmlElement.name()
,XmlAttribute.name()
,XmlType.name()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classPackageLocation
-
toString
public String toString()
- Overrides:
toString
in classPackageLocation
-
-