Examples of defineProperty()


Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

    result.removeProperty("labels");
   
    try {
      Method unitsGetter = this.getClass().getMethod("getUnits1D", new Class[0]);
      Method unitsSetter = this.getClass().getMethod("setUnits", new Class[]{Units.class});
      result.defineProperty(new SingleValuedPropertyImpl(result, "units", Units.class, unitsGetter, unitsSetter));
     
      Method valuesGetter = this.getClass().getMethod("getValues1D", new Class[0]);
      result.defineProperty(new SingleValuedPropertyImpl(result, "values", float[].class, valuesGetter));

      final Method labelGetter = this.getClass().getMethod("getLabels", new Class[0]);
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

      Method unitsGetter = this.getClass().getMethod("getUnits1D", new Class[0]);
      Method unitsSetter = this.getClass().getMethod("setUnits", new Class[]{Units.class});
      result.defineProperty(new SingleValuedPropertyImpl(result, "units", Units.class, unitsGetter, unitsSetter));
     
      Method valuesGetter = this.getClass().getMethod("getValues1D", new Class[0]);
      result.defineProperty(new SingleValuedPropertyImpl(result, "values", float[].class, valuesGetter));

      final Method labelGetter = this.getClass().getMethod("getLabels", new Class[0]);
      Method labelSetter = this.getClass().getMethod("setLabel", new Class[]{String.class});
      SingleValuedProperty labelProp = new SingleValuedPropertyImpl(result, "label", String.class, labelGetter, labelSetter) {
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

          }
          return result;
        }
       
      };
      result.defineProperty(labelProp);
    } catch (SecurityException e) {
      throw new RuntimeException("Can't access getter/setter -- this is a bug", e);
    } catch (NoSuchMethodException e) {
      throw new RuntimeException("Can't access getter/setter -- this is a bug", e);
    }
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

        result.defineSingleValuedProperty(propName, returnType, false);
      } else if (isIndexedGetter(methods[i]) && !result.getPropertyNames().contains(propName)) {
        Property p = ListPropertyImpl.getListProperty(result, propName, returnType);
        if (p != null) {
                    result.defineProperty(p);
                }
      } else if (isNamedGetter(methods[i]) && !result.getPropertyNames().contains(propName)) {
        Property p = NamedValuePropertyImpl.getNamedValueProperty(result, propName, returnType);
        if (p != null) {
                    result.defineProperty(p);
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

                    result.defineProperty(p);
                }
      } else if (isNamedGetter(methods[i]) && !result.getPropertyNames().contains(propName)) {
        Property p = NamedValuePropertyImpl.getNamedValueProperty(result, propName, returnType);
        if (p != null) {
                    result.defineProperty(p);
                }
      }
    }

    //look for additional array, list, and map getters
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

              && typeArgs[0] instanceof Class<?> && typeArgs[1] instanceof Class<?>) {
            p = NamedValuePropertyImpl.getNamedValueProperty(result, propName, (Class<?>) typeArgs[1]);
          }
        }
        if (p != null) {
                    result.defineProperty(p);
                }
      }
    }

    return result;
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

    ConfigurationImpl result = ConfigUtil.defaultConfiguration(this);
    result.removeProperty("basisDimension");
    try {
      Method getter = this.getClass().getMethod("getFunction", new Class[]{Integer.TYPE});
      Method countGetter = this.getClass().getMethod("getBasisDimension", new Class[0]);
      result.defineProperty(new ListPropertyImpl(result, "functions", Function.class, getter, countGetter));     
    } catch (Exception e) {
      throw new RuntimeException("Can't find function-related methods (this is a bug)", e);
    }
    return result;
  }
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

  /**
   * @return Custom configuration
   */
  public Configuration getConfiguration() {
    ConfigurationImpl result = ConfigUtil.defaultConfiguration(this);
    result.defineProperty(SingleValuedPropertyImpl.getSingleValuedProperty(result, "numDiscontinuities", Integer.TYPE));
    return result;
  }

  /**
   * @return Number of discontinuities
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

        p = new TemplateArrayProperty(result, names[i], types[i].getComponentType());
      } else {
        p = new TemplateProperty(result, names[i], types[i], ConfigUtil.getDefaultValue(types[i]));
      }
      p.setDocumentation(JavaSourceParser.getArgDocs(constructor, i));
      result.defineProperty(p);
    }
    return result;
  }

  private void setResult() throws StructuralException {
View Full Code Here

Examples of ca.nengo.config.impl.ConfigurationImpl.defineProperty()

  /**
   * @return Custom configuration
   */
  public Configuration getConfiguration() {
    ConfigurationImpl result = ConfigUtil.defaultConfiguration(this);
    result.defineProperty(SingleValuedPropertyImpl.getSingleValuedProperty(result, "numPoints", Integer.TYPE));
    return result;
  }

  /**
   * @return Number of points between which this function interpolates
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.