Class FieldLocation
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.PackageLocation
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.ClassLocation
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.FieldLocation
-
- All Implemented Interfaces:
java.lang.Comparable<SortableLocation>,SortableLocation
- Direct Known Subclasses:
MethodLocation
public class FieldLocation extends ClassLocation
Comparable path structure to locate a particular field within compilation unit.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmemberNameprivate java.lang.StringmemberXmlName
-
Constructor Summary
Constructors Constructor Description FieldLocation(java.lang.String packageName, java.lang.String className, java.lang.String classXmlName, java.lang.String memberName, java.lang.String memberXmlName)Creates a new FieldLocation with the supplied package, class and member names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAnnotationRenamedTo()Note: Packages cannot be renamed from a JAXB annotation.java.lang.StringgetMemberName()Retrieves the name of the member (i.e.java.lang.StringgetPath()Always appends the effective className to the path from the superclassPackageLocation.inthashCode()java.lang.StringtoString()-
Methods inherited from class org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.ClassLocation
getClassName
-
Methods inherited from class org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.location.PackageLocation
compareTo, equals, getPackageName, isEqualToPath
-
-
-
-
Constructor Detail
-
FieldLocation
public FieldLocation(java.lang.String packageName, java.lang.String className, java.lang.String classXmlName, java.lang.String memberName, java.lang.String memberXmlName)Creates a new FieldLocation with the supplied package, class and member names.- Parameters:
packageName- The name of the package for a class potentially holding JavaDoc. Cannot benull.className- The (simple) name of a class. Cannot be null or empty.memberName- The name of a (method or) field. Cannot be null or empty.classXmlName- The name given as theXmlType.name()value of an annotation placed on the Class, ornullif none is provided.memberXmlName- The name given as theXmlElement.name()orXmlAttribute.name()value of an annotation placed on this Field, ornullif none is provided.
-
-
Method Detail
-
getMemberName
public java.lang.String getMemberName()
Retrieves the name of the member (i.e. method or field), potentially holding JavaDoc.- Returns:
- The name of the member (i.e. method or field), potentially holding JavaDoc. Never null or empty.
-
getAnnotationRenamedTo
public java.lang.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:
getAnnotationRenamedToin interfaceSortableLocation- Overrides:
getAnnotationRenamedToin classClassLocation- 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 java.lang.String getPath()
Always appends the effective className to the path from the superclassPackageLocation. If theClassLocation.getAnnotationRenamedTo()method returns a non-null value, that value is the effective className. Otherwise, theClassLocation.getClassName()method is used as the effective className. This is to handle renames such as provided in aXmlTypeannotation'sXmlType.name()attribute value.- Specified by:
getPathin interfaceSortableLocation- Overrides:
getPathin classClassLocation- Returns:
- the path of the PackageLocation superclass, appended with the effective className.
- See Also:
XmlType,XmlAttribute.name(),XmlElement.name()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classClassLocation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classClassLocation
-
-