Package org.apache.jorphan.reflect

Examples of org.apache.jorphan.reflect.Functor


    table.revalidate();
  }
  private void initializeTableModel() {
    tableModel = new ObjectTableModel(new String[] { COLUMN_NAMES_0, COLUMN_NAMES_1 },
        new Functor[] {
        new Functor(Map.Entry.class, "getKey"), // $NON-NLS-1$
        new Functor(Map.Entry.class, "getValue") }// $NON-NLS-1$
        new Functor[] {
          null, //new Functor("setName"), // $NON-NLS-1$
        new Functor(Map.Entry.class,"setValue", new Class[] { Object.class }) // $NON-NLS-1$
      },
        new Class[] { String.class, String.class });
  }
View Full Code Here


  protected void initializeTableModel() {
    tableModel = new ObjectTableModel(new String[] {
        ArgumentsPanel.COLUMN_NAMES_0, ArgumentsPanel.COLUMN_NAMES_1, ENCODE_OR_NOT, INCLUDE_EQUALS },
        HTTPArgument.class,
        new Functor[] {
        new Functor("getName"), //$NON-NLS-1$
        new Functor("getValue"), //$NON-NLS-1$
        new Functor("isAlwaysEncoded"), //$NON-NLS-1$
        new Functor("isUseEquals") }, //$NON-NLS-1$
        new Functor[] {
        new Functor("setName"), //$NON-NLS-1$
        new Functor("setValue"), //$NON-NLS-1$
        new Functor("setAlwaysEncoded"), //$NON-NLS-1$
        new Functor("setUseEquals") }, //$NON-NLS-1$
        new Class[] {String.class, String.class, Boolean.class, Boolean.class });
  }
View Full Code Here

    private void initializeTableModel() {
        tableModel = new ObjectTableModel(new String[] {
                FILEPATH, PARAMNAME, MIMETYPE},
            HTTPFileArg.class,
            new Functor[] {
                new Functor("getPath"), //$NON-NLS-1$
                new Functor("getParamName"), //$NON-NLS-1$
                new Functor("getMimeType")}, //$NON-NLS-1$
            new Functor[] {
                new Functor("setPath"), //$NON-NLS-1$
                new Functor("setParamName"), //$NON-NLS-1$
                new Functor("setMimeType")}, //$NON-NLS-1$
            new Class[] {String.class, String.class, String.class});
    }
View Full Code Here

  public StatGraphVisualizer() {
    super();
    model = new ObjectTableModel(COLUMNS,
        SamplingStatCalculator.class,
        new Functor[] {
        new Functor("getLabel"),          //$NON-NLS-1$
        new Functor("getCount"),          //$NON-NLS-1$
        new Functor("getMeanAsNumber"),        //$NON-NLS-1$
        new Functor("getMedian"),          //$NON-NLS-1$
        new Functor("getPercentPoint",        //$NON-NLS-1$
        new Object[] { new Float(.900) }),
        new Functor("getMin"),            //$NON-NLS-1$
        new Functor("getMax"),             //$NON-NLS-1$
        new Functor("getErrorPercentage"),          //$NON-NLS-1$
        new Functor("getRate"),                //$NON-NLS-1$
        new Functor("getKBPerSecond") },      //$NON-NLS-1$
        new Functor[] { null, null, null, null, null, null, null, null,  null, null },
        new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
        Long.class, String.class, String.class, String.class });
    clearData();
    init();
View Full Code Here

    public SummaryReport() {
    super();
    model = new ObjectTableModel(COLUMNS,
        Calculator.class,// All rows have this class
                new Functor[] {
                    new Functor("getLabel"),              //$NON-NLS-1$
                    new Functor("getCount"),              //$NON-NLS-1$
            new Functor("getMeanAsNumber"),       //$NON-NLS-1$
                    new Functor("getMin"),                //$NON-NLS-1$
                    new Functor("getMax"),                //$NON-NLS-1$
                    new Functor("getStandardDeviation")//$NON-NLS-1$
                    new Functor("getErrorPercentage"),    //$NON-NLS-1$
                    new Functor("getRate"),               //$NON-NLS-1$
            new Functor("getKBPerSecond"),        //$NON-NLS-1$
                    new Functor("getAvgPageBytes"),       //$NON-NLS-1$
                },
                new Functor[] { null, null, null, null, null, null, null, null , null, null },
                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class,
                              String.class, String.class, String.class, String.class, String.class });
    clearData();
View Full Code Here

   * Initialize the table model used for the arguments table.
   */
  protected void initializeTableModel() {
    tableModel = new ObjectTableModel(new String[] { COLUMN_NAMES[0], COLUMN_NAMES[1], COLUMN_NAMES[2] },
        LDAPArgument.class,
        new Functor[] { new Functor("getName"), new Functor("getValue"), new Functor("getOpcode") },
        new Functor[] { new Functor("setName"), new Functor("setValue"), new Functor("setOpcode") },
        new Class[] { String.class, String.class, String.class });
  }
View Full Code Here

            checkPanel.add(check, BorderLayout.NORTH);
            check.addActionListener(this);
                        String actionCommand = NAME_SET_PREFIX + name; // $NON-NLS-1$
            check.setActionCommand(actionCommand);
                        if (!functors.containsKey(actionCommand)) {
              functors.put(actionCommand, new Functor(actionCommand));
            }
          } catch (Exception e) {
            log.warn("Problem creating save config dialog", e);
          }
        }
View Full Code Here

   *
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(ActionEvent e) {
    String action = e.getActionCommand();
    Functor f = (Functor) functors.get(action);
    f.invoke(saveConfig, new Object[] {
                Boolean.valueOf(((JCheckBox) e.getSource()).isSelected()) });
  }
View Full Code Here

    for(int i=0;i<parts.length;i++){
      String label = parts[i];
      if (isVariableName(label)){
        varCount++;
      } else {
        Functor set = (Functor) headerLabelMethods.get(label);
        set.invoke(saveConfig,new Boolean[]{Boolean.TRUE});
      }
    }

    if (delim != null){
      log.warn("Default delimiter '"+_saveConfig.getDelimiter()+"' did not work; using alternate '"+delim+"' for reading "+filename);
View Full Code Here

    log.debug("Getting row value");
    Object value = objects.get(row);
    if(headers.size() == 1 && col >= readFunctors.size()) {
      return value;
    }
    Functor getMethod = (Functor) readFunctors.get(col);
    if (getMethod != null && value != null) {
      return getMethod.invoke(value);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.jorphan.reflect.Functor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.