Package org.openjdk.jmc.common.item
Interface IType<T>
-
- Type Parameters:
T
- class of the objects that the type is used for
- All Superinterfaces:
IDescribable
- All Known Implementing Classes:
ContentType
,KindOfQuantity
,LinearKindOfQuantity
,RangeContentType
,StructContentType
public interface IType<T> extends IDescribable
A type for objects of class T. They may have properties that can be accessed by usingmember accessors
. If so, then items of the same type are expected to share the same behavior when accessed by accessors.Analogous to
Class
in the Java type system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <M> IMemberAccessor<M,T>
getAccessor(IAccessorKey<M> attribute)
Internal low-level mechanism for retrieving a member accessor for a type, or null if not available.Map<IAccessorKey<?>,? extends IDescribable>
getAccessorKeys()
Get keys for the accessors that this type knows of.List<IAttribute<?>>
getAttributes()
Deprecated.String
getIdentifier()
String identifying the type.boolean
hasAttribute(ICanonicalAccessorFactory<?> attribute)
-
Methods inherited from interface org.openjdk.jmc.common.IDescribable
getDescription, getName
-
-
-
-
Method Detail
-
getAttributes
@Deprecated List<IAttribute<?>> getAttributes()
Deprecated.
-
getAccessorKeys
Map<IAccessorKey<?>,? extends IDescribable> getAccessorKeys()
Get keys for the accessors that this type knows of. Note that the returned accessors does not necessarily cover all possible data from the items of this type, and that it is always possible to define additional accessors that get or calculate values from the items in non-standard ways.Should only be used for low level type inspection. Iterators etc. should use a collection of predefined
attributes
.- Returns:
- keys for the accessors defined for this type
-
hasAttribute
boolean hasAttribute(ICanonicalAccessorFactory<?> attribute)
Tell ifattribute
can return anaccessor
for thistype
. This method is semantically equivalent toattribute.
, but may be cheaper.getAccessor(type)
!= null- Parameters:
attribute
- attribute to check- Returns:
true
if the attribute can return an accessor for this type,false
if not
-
getAccessor
<M> IMemberAccessor<M,T> getAccessor(IAccessorKey<M> attribute)
Internal low-level mechanism for retrieving a member accessor for a type, or null if not available.This is only intended to be used by implementors of
IAccessorFactory
. All other usage should be replaced withICanonicalAccessorFactory.getAccessor(IType)
call to pre-defined accessors.- Type Parameters:
M
- accessor value type- Parameters:
attribute
- the identifier for the field- Returns:
- a member accessor
-
getIdentifier
String getIdentifier()
String identifying the type. It must never be localized and it should only contain characters that are safe to use in various configuration files, e.g. in XML.- Returns:
- type identifier
-
-