public ValidationResult validateAccessor(Accessor accessor) {
ValidationResult result = new ValidationResult();
if (accessor.getDelegate() instanceof PropertyDeclaration) {
PropertyDeclaration property = (PropertyDeclaration) accessor.getDelegate();
DecoratedMethodDeclaration getter = property.getGetter();
DecoratedMethodDeclaration setter = property.getSetter();
if ((getter != null) && (setter != null)) {
//find all JAXB annotations that are on both the setter and the getter...
Map<String, AnnotationMirror> getterAnnotations = getter.getAnnotations();
Map<String, AnnotationMirror> setterAnnotations = setter.getAnnotations();
for (String annotation : getterAnnotations.keySet()) {
if ((annotation.startsWith(XmlElement.class.getPackage().getName())) && (setterAnnotations.containsKey(annotation))) {
result.addError(setter, "'" + annotation + "' is on both the getter and setter.");
}
}