当前位置: 首页>>代码示例>>Java>>正文


Java EventSetDescriptor类代码示例

本文整理汇总了Java中com.googlecode.openbeans.EventSetDescriptor的典型用法代码示例。如果您正苦于以下问题:Java EventSetDescriptor类的具体用法?Java EventSetDescriptor怎么用?Java EventSetDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EventSetDescriptor类属于com.googlecode.openbeans包,在下文中一共展示了EventSetDescriptor类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
void init() {
    if (this.events == null) {
        events = new EventSetDescriptor[0];
    }
    if (this.properties == null) {
        this.properties = new PropertyDescriptor[0];
    }

    if (properties != null) {
        String defaultPropertyName = (defaultPropertyIndex != -1 ? properties[defaultPropertyIndex]
                .getName()
                : null);
        Arrays.sort(properties, comparator);
        if (null != defaultPropertyName) {
            for (int i = 0; i < properties.length; i++) {
                if (defaultPropertyName.equals(properties[i].getName())) {
                    defaultPropertyIndex = i;
                    break;
                }
            }
        }
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:24,代码来源:StandardBeanInfo.java

示例2: EventSetDescriptor

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
public EventSetDescriptor(Class<?> sourceClass, String eventSetName,
        Class<?> listenerType, String listenerMethodName)
        throws IntrospectionException {
    checkNotNull(sourceClass, eventSetName, listenerType,
            listenerMethodName);
    setName(eventSetName);
    this.listenerType = listenerType;

    Method method = findListenerMethodByName(listenerMethodName);
    checkEventType(eventSetName, method);
    listenerMethodDescriptors = new ArrayList<MethodDescriptor>();
    listenerMethodDescriptors.add(new MethodDescriptor(method));
    addListenerMethod = findMethodByPrefix(sourceClass, "add", ""); //$NON-NLS-1$ //$NON-NLS-2$
    removeListenerMethod = findMethodByPrefix(sourceClass, "remove", ""); //$NON-NLS-1$ //$NON-NLS-2$

    if (addListenerMethod == null || removeListenerMethod == null) {
        throw new IntrospectionException(Messages.getString("beans.38")); //$NON-NLS-1$
    }

    getListenerMethod = findMethodByPrefix(sourceClass, "get", "s"); //$NON-NLS-1$ //$NON-NLS-2$
    unicast = isUnicastByDefault(addListenerMethod);
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:23,代码来源:EventSetDescriptor.java

示例3: merge

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
void merge(EventSetDescriptor event) {
    super.merge(event);
    if (addListenerMethod == null) {
        addListenerMethod = event.addListenerMethod;
    }
    if (getListenerMethod == null) {
        getListenerMethod = event.getListenerMethod;
    }
    if (listenerMethodDescriptors == null) {
        listenerMethodDescriptors = event.listenerMethodDescriptors;
    }
    if (listenerMethods == null) {
        listenerMethods = event.listenerMethods;
    }
    if (listenerType == null) {
        listenerType = event.listenerType;
    }

    if (removeListenerMethod == null) {
        removeListenerMethod = event.removeListenerMethod;
    }
    inDefaultEventSet &= event.inDefaultEventSet;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:24,代码来源:EventSetDescriptor.java

示例4: mergeBeanInfo

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
void mergeBeanInfo(BeanInfo beanInfo, boolean force)
        throws IntrospectionException {
    if (force || !explicitProperties) {
        PropertyDescriptor[] superDescs = beanInfo.getPropertyDescriptors();
        if (superDescs != null) {
            if (getPropertyDescriptors() != null) {
                properties = mergeProps(superDescs, beanInfo
                        .getDefaultPropertyIndex());
            } else {
                properties = superDescs;
                defaultPropertyIndex = beanInfo.getDefaultPropertyIndex();
            }
        }
    }

    if (force || !explicitMethods) {
        MethodDescriptor[] superMethods = beanInfo.getMethodDescriptors();
        if (superMethods != null) {
            if (methods != null) {
                methods = mergeMethods(superMethods);
            } else {
                methods = superMethods;
            }
        }
    }

    if (force || !explicitEvents) {
        EventSetDescriptor[] superEvents = beanInfo
                .getEventSetDescriptors();
        if (superEvents != null) {
            if (events != null) {
                events = mergeEvents(superEvents, beanInfo
                        .getDefaultEventIndex());
            } else {
                events = superEvents;
                defaultEventIndex = beanInfo.getDefaultEventIndex();
            }
        }
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:41,代码来源:StandardBeanInfo.java

示例5: mergeEvents

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
private EventSetDescriptor[] mergeEvents(EventSetDescriptor[] otherEvents,
        int otherDefaultIndex) {
    HashMap<String, EventSetDescriptor> subMap = internalAsMap(events);
    String defaultEventName = null;
    if (defaultEventIndex >= 0 && defaultEventIndex < events.length) {
        defaultEventName = events[defaultEventIndex].getName();
    } else if (otherDefaultIndex >= 0
            && otherDefaultIndex < otherEvents.length) {
        defaultEventName = otherEvents[otherDefaultIndex].getName();
    }

    for (EventSetDescriptor event : otherEvents) {
        String eventName = event.getName();
        EventSetDescriptor subEvent = subMap.get(eventName);
        if (subEvent == null) {
            subMap.put(eventName, event);
        } else {
            subEvent.merge(event);
        }
    }

    EventSetDescriptor[] theEvents = new EventSetDescriptor[subMap.size()];
    subMap.values().toArray(theEvents);

    if (defaultEventName != null && !explicitEvents) {
        for (int i = 0; i < theEvents.length; i++) {
            if (defaultEventName.equals(theEvents[i].getName())) {
                defaultEventIndex = i;
                break;
            }
        }
    }
    return theEvents;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:35,代码来源:StandardBeanInfo.java

示例6: internalAsMap

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
private static HashMap<String, EventSetDescriptor> internalAsMap(
        EventSetDescriptor[] theDescs) {
    HashMap<String, EventSetDescriptor> map = new HashMap<String, EventSetDescriptor>();
    for (int i = 0; i < theDescs.length; i++) {
        map.put(theDescs[i].getName(), theDescs[i]);
    }
    return map;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:9,代码来源:StandardBeanInfo.java

示例7: getEventSetDescriptors

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
    return events;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:5,代码来源:StandardBeanInfo.java

示例8: getEventSetDescriptors

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
public EventSetDescriptor[] getEventSetDescriptors() {
    return null;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:4,代码来源:SimpleBeanInfo.java

示例9: getEventSetDescriptors

import com.googlecode.openbeans.EventSetDescriptor; //导入依赖的package包/类
public EventSetDescriptor[] getEventSetDescriptors(); 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:2,代码来源:BeanInfo.java


注:本文中的com.googlecode.openbeans.EventSetDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。