Package org.yaml.snakeyaml.introspector
Class FieldProperty
- java.lang.Object
-
- org.yaml.snakeyaml.introspector.Property
-
- org.yaml.snakeyaml.introspector.GenericProperty
-
- org.yaml.snakeyaml.introspector.FieldProperty
-
- All Implemented Interfaces:
Comparable<Property>
public class FieldProperty extends GenericProperty
A
FieldProperty
is aProperty
which is accessed as a field, without going through accessor methods (setX, getX). The field may have any scope (public, package, protected, private).
-
-
Constructor Summary
Constructors Constructor Description FieldProperty(Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get(Object object)
<A extends Annotation>
AgetAnnotation(Class<A> annotationType)
Returns property's annotation for the given type ornull
if it's not present.List<Annotation>
getAnnotations()
Returns the annotations that are present on this property or emptyList
if there're no annotations.void
set(Object object, Object value)
-
Methods inherited from class org.yaml.snakeyaml.introspector.GenericProperty
getActualTypeArguments
-
Methods inherited from class org.yaml.snakeyaml.introspector.Property
compareTo, equals, getName, getType, hashCode, isReadable, isWritable, toString
-
-
-
-
Constructor Detail
-
FieldProperty
public FieldProperty(Field field)
-
-
Method Detail
-
getAnnotations
public List<Annotation> getAnnotations()
Description copied from class:Property
Returns the annotations that are present on this property or emptyList
if there're no annotations.- Specified by:
getAnnotations
in classProperty
- Returns:
- the annotations that are present on this property or empty
List
if there're no annotations
-
getAnnotation
public <A extends Annotation> A getAnnotation(Class<A> annotationType)
Description copied from class:Property
Returns property's annotation for the given type ornull
if it's not present.- Specified by:
getAnnotation
in classProperty
- Type Parameters:
A
- class of the annotation- Parameters:
annotationType
- the type of the annotation to be returned- Returns:
- property's annotation for the given type or
null
if it's not present
-
-