Package org.apache.jorphan.reflect

Examples of org.apache.jorphan.reflect.Functor


   */
  public void setValueAt(Object cellValue, int row, int col) {
    if (row < objects.size()) {
      Object value = objects.get(row);
      if (col < writeFunctors.size()) {
        Functor setMethod = (Functor) writeFunctors.get(col);
        if (setMethod != null) {
          setMethod.invoke(value, new Object[] { cellValue });
          super.fireTableDataChanged();
        }
      }
      else if(headers.size() == 1)
      {
View Full Code Here


    } else {
      value = _value;     
    }
    boolean status = true;
    for(int i=0;i<getColumnCount();i++){
      Functor setMethod = (Functor) writeFunctors.get(i);
      if (setMethod != null) {
        if (!setMethod.checkMethod(value,getColumnClass(i))){
          status=false;
          log.warn(caller.getName()+" is attempting to use nonexistent "+setMethod.toString());
        }
      }
      Functor getMethod = (Functor) readFunctors.get(i);
      if (getMethod != null) {
        if (!getMethod.checkMethod(value)){
          status=false;
          log.warn(caller.getName()+" is attempting to use nonexistent "+getMethod.toString());
        }
      }
     
    }
    return status;
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()
View Full Code Here

    private JPanel makeArgumentsPanel() {
        argsPanel = new ArgumentsPanel(JMeterUtils.getResString("arguments_panel_title"), null, true, false // $NON-NLS-1$
                new ObjectTableModel(new String[] { ArgumentsPanel.COLUMN_RESOURCE_NAMES_1 },
                        Argument.class,
                        new Functor[] {
                        new Functor("getValue") }// $NON-NLS-1$
                        new Functor[] {
                        new Functor("setValue") }, // $NON-NLS-1$
                        new Class[] {String.class }));
        return argsPanel;
    }
View Full Code Here

    // We know the column names all exist, so create the config
    SampleSaveConfiguration saveConfig=new SampleSaveConfiguration(false);
   
    for(int i=0;i<parts.length;i++){
      Functor set = (Functor) headerLabelMethods.get(parts[i]);
      set.invoke(saveConfig,new Boolean[]{Boolean.TRUE});
    }
    return saveConfig;
  }
View Full Code Here

    // We know the column names all exist, so create the config
    SampleSaveConfiguration saveConfig=new SampleSaveConfiguration(false);
   
    for(int i=0;i<parts.length;i++){
      Functor set = (Functor) headerLabelMethods.get(parts[i]);
      set.invoke(saveConfig,new Boolean[]{Boolean.TRUE});
    }
    return saveConfig;
  }
View Full Code Here

     * Initialize the table model used for the arguments table.
     */
    private 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

        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

    public TableVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                TableSample.class,         // The object used for each row
                new Functor[] {
                new Functor("getSampleNumberString"), // $NON-NLS-1$
                new Functor("getStartTimeFormatted"// $NON-NLS-1$
                        new Object[]{format}),
                new Functor("getThreadName"), // $NON-NLS-1$
                new Functor("getLabel"), // $NON-NLS-1$
                new Functor("getElapsed"), // $NON-NLS-1$
                new SampleSuccessFunctor("isSuccess"), // $NON-NLS-1$
                new Functor("getBytes"), // $NON-NLS-1$
                new Functor("getLatency") }, // $NON-NLS-1$
                new Functor[] { null, null, null, null, null, null, null, null },
                new Class[] {
                String.class, String.class, String.class, String.class, Long.class, ImageIcon.class, Long.class, Long.class });
        init();
    }
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 });
        eltList.add(new BarGraph("average", true, new Color(202, 0, 0)));
        eltList.add(new BarGraph("aggregate_report_median", false, new Color(49, 49, 181)));
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.