public enum TypeValuePolicy extends Enum<TypeValuePolicy>
MetadataStandard.asTypeMap(…)
.
This enumeration specifies whether the values shall be property types, element types (same
as property types except for collections) or the declaring classes.MetadataStandard.asTypeMap(Class, KeyNamePolicy, TypeValuePolicy)
Defined in the sis-metadata module
Enum Constant and Description |
---|
DECLARING_CLASS
The type of the class that declares the method.
|
DECLARING_INTERFACE
The type of the interface that declares the method.
|
ELEMENT_TYPE
The type of a property, or type of elements if the property is a collection.
|
PROPERTY_TYPE
The type of a property, as inferred from the
return type of the property method.
|
Modifier and Type | Method and Description |
---|---|
static TypeValuePolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TypeValuePolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TypeValuePolicy PROPERTY_TYPE
Collection.class
(or a subclass).public static final TypeValuePolicy ELEMENT_TYPE
PROPERTY_TYPE
except that collections are handled in a special way:
if the property is a collection, then the value is the type of elements in that
collection.
Note: Current implementation has an additional slight difference: if the getter method in the implementation class declares a more specific return value than the getter method in the interface, and if the setter method (if any) expects the same specialized type, thenELEMENT_TYPE
will use that specialized type. This is different thanPROPERTY_TYPE
which always use the type declared in the interface.
public static final TypeValuePolicy DECLARING_INTERFACE
public static final TypeValuePolicy DECLARING_CLASS
DECLARING_INTERFACE
, except that the implementation class
from the metadata standard is returned instead than the interface.public static TypeValuePolicy[] values()
for (TypeValuePolicy c : TypeValuePolicy.values()) System.out.println(c);
public static TypeValuePolicy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullCopyright © 2010–2013 The Apache Software Foundation. All rights reserved.