Package org.yaml.snakeyaml.introspector
Class Property
- java.lang.Object
-
- org.yaml.snakeyaml.introspector.Property
-
- All Implemented Interfaces:
java.lang.Comparable<Property>
- Direct Known Subclasses:
GenericProperty,MissingProperty,PropertySubstitute
public abstract class Property extends java.lang.Object implements java.lang.Comparable<Property>
A
Propertyrepresents 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.
-
-
Constructor Summary
Constructors Constructor Description Property(java.lang.String name, java.lang.Class<?> type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(Property o)booleanequals(java.lang.Object other)abstract java.lang.Objectget(java.lang.Object object)abstract java.lang.Class<?>[]getActualTypeArguments()abstract <A extends java.lang.annotation.Annotation>
AgetAnnotation(java.lang.Class<A> annotationType)Returns property's annotation for the given type ornullif it's not present.abstract java.util.List<java.lang.annotation.Annotation>getAnnotations()Returns the annotations that are present on this property or emptyListif there're no annotations.java.lang.StringgetName()java.lang.Class<?>getType()inthashCode()booleanisReadable()booleanisWritable()abstract voidset(java.lang.Object object, java.lang.Object value)java.lang.StringtoString()
-
-
-
Method Detail
-
getType
public java.lang.Class<?> getType()
-
getActualTypeArguments
public abstract java.lang.Class<?>[] getActualTypeArguments()
-
getName
public java.lang.String getName()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(Property o)
- Specified by:
compareToin interfacejava.lang.Comparable<Property>
-
isWritable
public boolean isWritable()
-
isReadable
public boolean isReadable()
-
set
public abstract void set(java.lang.Object object, java.lang.Object value) throws java.lang.Exception- Throws:
java.lang.Exception
-
get
public abstract java.lang.Object get(java.lang.Object object)
-
getAnnotations
public abstract java.util.List<java.lang.annotation.Annotation> getAnnotations()
Returns the annotations that are present on this property or emptyListif there're no annotations.- Returns:
- the annotations that are present on this property or empty
Listif there're no annotations
-
getAnnotation
public abstract <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
Returns property's annotation for the given type ornullif 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
nullif it's not present
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-