Package org.yaml.snakeyaml.introspector
Class Property
- java.lang.Object
-
- org.yaml.snakeyaml.introspector.Property
-
- All Implemented Interfaces:
Comparable<Property>
- Direct Known Subclasses:
GenericProperty
,MissingProperty
,PropertySubstitute
public abstract class Property extends Object implements Comparable<Property>
A
Property
represents a single member variable of a class, possibly including its accessor methods (getX, setX). The name stored in this class is the actual name of the property as given for the class, not an alias.Objects of this class have a total ordering which defaults to ordering based on the name of the property.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(Property o)
boolean
equals(Object other)
abstract Object
get(Object object)
abstract Class<?>[]
getActualTypeArguments()
abstract <A extends Annotation>
AgetAnnotation(Class<A> annotationType)
Returns property's annotation for the given type ornull
if it's not present.abstract List<Annotation>
getAnnotations()
Returns the annotations that are present on this property or emptyList
if there're no annotations.String
getName()
Class<?>
getType()
int
hashCode()
boolean
isReadable()
boolean
isWritable()
abstract void
set(Object object, Object value)
String
toString()
-
-
-
Method Detail
-
getType
public Class<?> getType()
-
getActualTypeArguments
public abstract Class<?>[] getActualTypeArguments()
-
getName
public String getName()
-
compareTo
public int compareTo(Property o)
- Specified by:
compareTo
in interfaceComparable<Property>
-
isWritable
public boolean isWritable()
-
isReadable
public boolean isReadable()
-
getAnnotations
public abstract List<Annotation> getAnnotations()
Returns the annotations that are present on this property or emptyList
if there're no annotations.- Returns:
- the annotations that are present on this property or empty
List
if there're no annotations
-
getAnnotation
public abstract <A extends Annotation> A getAnnotation(Class<A> annotationType)
Returns property's annotation for the given type ornull
if it's not present.- 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
-
-