Java 8 EventSetDescriptor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 EventSetDescriptor class.

This code example shows how to use the following methods:getAddListenerMethod, getGetListenerMethod, getListenerType, getRemoveListenerMethod, getName
 
    /** 
     * Reports all the interesting information in an EventSetDescriptor 
     */ 
    public static void reportEventSetDescriptor(EventSetDescriptor esd) {
        System.out.println("event set name:   " + esd.getName());
        System.out.println(" listener type:   " + esd.getListenerType());
        System.out.println("   method get:    " + esd.getGetListenerMethod());
        System.out.println("   method add:    " + esd.getAddListenerMethod());
        System.out.println("   method remove: " + esd.getRemoveListenerMethod());
    } 
 
    /** 
     * Reports all the interesting information in a MethodDescriptor 
     */ 
    public static void reportMethodDescriptor(MethodDescriptor md) {
        System.out.println("method name: " + md.getName());
        System.out.println("     method: " + md.getMethod());
    } 
} 
6
CodeRank
This code example shows how to use the following methods:
            Method addListener = StrangeBean.class.getMethod("addStrangeEventListener", new Class[] {StrangeEventListener.class});
            Method removeListener = StrangeBean.class.getMethod("removeStrangeEventListener", new Class[] {StrangeEventListener.class});
            Method getListeners = StrangeBean.class.getMethod("getStrangeEventListeners", new Class[0]);
             
            return new EventSetDescriptor[] {
                new EventSetDescriptor( 
                        "strangeEvent", 
                        StrangeEventListener.class,  
                        events,
                        addListener,
                        removeListener,
                        getListeners)
            }; 
        } catch (Exception e) {
            e.printStackTrace(System.out);
            return super.getEventSetDescriptors(); 
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getName
    m_logger = logger;
  } 
 
  @Override 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  @Override 
  public boolean connectionAllowed(String eventName) {
    return (m_listenee == null); 
  } 
 
  @Override 
  public void connectionNotification(String eventName, Object source) {
    if (connectionAllowed(eventName)) {
      m_listenee = source; 
    } 
  } 
 
5
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Notify this object that it has been registered as a listener with 
   * a source with respect to the supplied event name 
   * 
   * @param eventName the event 
   * @param source the source with which this object has been registered as 
   * a listener 
   */ 
  public synchronized void connectionNotification(String eventName,
						  Object source) { 
    if (connectionAllowed(eventName)) {
      m_listenee = source; 
5
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Returns true if, at this time,  
   * the object will accept a connection according to the supplied 
   * event name 
   * 
   * @param eventName the event 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(String eventName) {
    return (m_listenee == null); 
  } 
 
5
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Notify this object that it has been registered as a listener with 
   * a source with respect to the supplied event name 
   * 
   * @param eventName 
   * @param source the source with which this object has been registered as 
   * a listener 
   */ 
  public synchronized void connectionNotification(String eventName,
						  Object source) { 
    if (connectionAllowed(eventName)) {
      m_listenee = source; 
5
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Notify this object that it has been registered as a listener with 
   * a source with respect to the supplied event name 
   * 
   * @param eventName the event 
   * @param source the source with which this object has been registered as 
   * a listener 
   */ 
  public synchronized void connectionNotification(String eventName,
						  Object source) { 
    if (connectionAllowed(eventName)) {
      if (eventName.compareTo("dataSet") == 0) {
4
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Notify this object that it has been registered as a listener with 
   * a source with respect to the supplied event name 
   * 
   * @param eventName the event name 
   * @param source the source with which this object has been registered as 
   * a listener 
   */ 
  public synchronized void connectionNotification(String eventName,
						  Object source) { 
    if (connectionAllowed(eventName)) {
      m_listenee = source; 
5
CodeRank
This code example shows how to use the following methods:getName
   * 
   * @param esd the EventSetDescriptor 
   * @return true if the object will accept a connection 
   */ 
  public boolean connectionAllowed(EventSetDescriptor esd) {
    return connectionAllowed(esd.getName());
  } 
 
  /** 
   * Notify this object that it has been registered as a listener with 
   * a source with respect to the supplied event name 
   * 
   * @param eventName the event name 
   * @param source the source with which this object has been registered as 
   * a listener 
   */ 
  public synchronized void connectionNotification(String eventName,
						  Object source) { 
    if (connectionAllowed(eventName)) {
      m_listenee = source; 
5
CodeRank
This code example shows how to use the following methods:
   * @return an <code>EventSetDescriptor[]</code> value 
   */ 
  public EventSetDescriptor [] getEventSetDescriptors() {
    try { 
      EventSetDescriptor [] esds = { 
	new EventSetDescriptor(IncrementalClassifierEvaluator.class, 
			       "chart",  
			       ChartListener.class,  
			       "acceptDataPoint"), 
	new EventSetDescriptor(IncrementalClassifierEvaluator.class,
			       "text", 
			       TextListener.class, 
			       "acceptText") 
      }; 
      return esds;
    } catch (Exception ex) {
      ex.printStackTrace();
    } 
    return null; 
  } 
3
CodeRank
See Code Examples for Java 8 EventSetDescriptor Methods: