java 高新技术_Java高新技术——内省Introspector(JavaBean) | Soo Smart!

Java高新技术——内省(JavaBean)下面这篇文章写的不错,通俗易懂,建议先看下文章中的示例:https://blog.csdn.net/zhongkelee/article/details/52678667

截取仅供快速参考。

Interface Summary

Interface

Description

Deprecated.

The Applet API is deprecated.

Use the BeanInfo interface to create a BeanInfo class and provide explicit information about the methods, properties, events, and other features of your beans.

A customizer class provides a complete custom GUI for customizing a target Java Bean.

This interface is intended to be implemented by, or delegated from, instances of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.

An ExceptionListener is notified of internal exceptions.

A "PropertyChange" event gets fired whenever a bean changes a "bound" property.

A PropertyEditor class provides support for GUIs that want to allow users to edit a property value of a given type.

A VetoableChange event gets fired whenever a bean changes a "constrained" property.

Under some circumstances a bean may be run on servers where a GUI is not available.

Class Summary

Class

Description

A BeanDescriptor provides global information about a "bean", including its Java class, its displayName, etc.

This class provides some general purpose beans control methods.

The DefaultPersistenceDelegate is a concrete implementation of the abstract PersistenceDelegate class and is the delegate used by default for classes about which no information is available.

An Encoder is a class which can be used to create files or streams that encode the state of a collection of JavaBeans in terms of their public APIs.

The EventHandler class provides support for dynamically generating event listeners whose methods execute a simple statement involving an incoming event object and a target object.

An EventSetDescriptor describes a group of events that a given Java bean fires.

An Expression object represents a primitive expression in which a single method is applied to a target and a set of arguments to return a result - as in "a.getFoo()".

The FeatureDescriptor class is the common baseclass for PropertyDescriptor, EventSetDescriptor, and MethodDescriptor, etc.

An "IndexedPropertyChange" event gets delivered whenever a component that conforms to the JavaBeans™ specification (a "bean") changes a bound indexed property.

An IndexedPropertyDescriptor describes a property that acts like an array and has an indexed read and/or indexed write method to access specific elements of the array.

The Introspector class provides a standard way for tools to learn about the properties, events, and methods supported by a target Java Bean.

A MethodDescriptor describes a particular method that a Java Bean supports for external access from other components.

The ParameterDescriptor class allows bean implementors to provide additional information on each of their parameters, beyond the low level type information provided by the java.lang.reflect.Method class.

The PersistenceDelegate class takes the responsibility for expressing the state of an instance of a given class in terms of the methods in the class's public API.

A "PropertyChange" event gets delivered whenever a bean changes a "bound" or "constrained" property.

A class which extends the EventListenerProxy specifically for adding a PropertyChangeListener with a "bound" property.

This is a utility class that can be used by beans that support bound properties.

A PropertyDescriptor describes one property that a Java Bean exports via a pair of accessor methods.

The PropertyEditorManager can be used to locate a property editor for any given type name.

This is a support class to help build property editors.

This is a support class to make it easier for people to provide BeanInfo classes.

A Statement object represents a primitive statement in which a single method is applied to a target and a set of arguments - as in "a.setFoo(b)".

A class which extends the EventListenerProxy specifically for adding a VetoableChangeListener with a "constrained" property.

This is a utility class that can be used by beans that support constrained properties.

The XMLDecoder class is used to read XML documents created using the XMLEncoder and is used just like the ObjectInputStream.

The XMLEncoder class is a complementary alternative to the ObjectOutputStream and can used to generate a textual representation of a JavaBean in the same way that the ObjectOutputStream can be used to create binary representation of Serializable objects.

Exception Summary

Exception

Description

Thrown when an exception happens during Introspection.

A PropertyVetoException is thrown when a proposed change to a property represents an unacceptable value.

Annotation Types Summary

Annotation Type

Description

An annotation used to specify some property-related information for the automatically generated BeanInfo classes.

An annotation on a constructor that shows how the parameters of that constructor correspond to the constructed object's getter methods.

An annotation used to specify some class-related information for the automatically generated BeanInfo classes.

Indicates that an attribute called "transient" should be declared with the given value when the Introspector constructs a PropertyDescriptor or EventSetDescriptor classes associated with the annotated code element.

PropertyDescriptor​(String propertyName, Class> beanClass)

///

Introspector的静态方法:

static Stringdecapitalize​(String name)

Utility method to take a string and convert it to normal Java variable name capitalization.

static voidflushCaches()

Flush all of the Introspector's internal caches.

static voidflushFromCaches​(Class> clz)

Flush the Introspector's internal cached information for a given class.

static BeanInfogetBeanInfo​(Class> beanClass)

Introspect on a Java Bean and learn about all its properties, exposed methods, and events.

static BeanInfogetBeanInfo​(Class> beanClass, int flags)

Introspect on a Java bean and learn about all its properties, exposed methods, and events, subject to some control flags.

static BeanInfogetBeanInfo​(Class> beanClass, Class> stopClass)

Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.

static BeanInfogetBeanInfo​(Class> beanClass, Class> stopClass, int flags)

Introspect on a Java Bean and learn about all its properties, exposed methods and events, below a given stopClass point subject to some control flags.

static String[]getBeanInfoSearchPath()

Gets the list of package names that will be used for finding BeanInfo classes.

static voidsetBeanInfoSearchPath​(String[] path)

Change the list of package names that will be used for finding BeanInfo classes.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值