Package org.geomajas.layer.feature.attribute

Examples of org.geomajas.layer.feature.attribute.ShortAttribute


    switch (getType()) {
      case BOOLEAN:
        result = new BooleanAttribute((Boolean) value);
        break;
      case SHORT:
        result = new ShortAttribute((Short) value);
        break;
      case INTEGER:
        result = new IntegerAttribute((Integer) value);
        break;
      case LONG:
View Full Code Here


    FeatureBean bean = new FeatureBean();
    attributes.put("stringAttr", new StringAttribute("s1"));
    attributes.put("doubleAttr", new DoubleAttribute(1.23));
    attributes.put("longAttr", new LongAttribute(12L));
    attributes.put("floatAttr", new FloatAttribute(1.67F));
    attributes.put("shortAttr", new ShortAttribute((short) 6));
    attributes.put("urlAttr", new UrlAttribute("http://haha"));
    service.setAttributes(bean, layerBeans.getLayerInfo().getFeatureInfo(), new DummyMapper(), attributes);
    Assert.assertEquals("s1", bean.getStringAttr());
    Assert.assertEquals(1.23, bean.getDoubleAttr(), 0.0001);
    Assert.assertEquals(12L, bean.getLongAttr().longValue());
View Full Code Here

  private Attribute<?> toPrimitiveDto(Object value, PrimitiveAttributeInfo info) {
    switch (info.getType()) {
      case BOOLEAN:
        return new BooleanAttribute((Boolean) convertToClass(value, Boolean.class));
      case SHORT:
        return new ShortAttribute((Short) convertToClass(value, Short.class));
      case INTEGER:
        return new IntegerAttribute((Integer) convertToClass(value, Integer.class));
      case LONG:
        return new LongAttribute((Long) convertToClass(value, Long.class));
      case FLOAT:
View Full Code Here

    switch (info.getType()) {
      case BOOLEAN:
        attribute = new BooleanAttribute();
        break;
      case SHORT:
        attribute = new ShortAttribute();
        break;
      case INTEGER:
        attribute = new IntegerAttribute();
        break;
      case LONG:
View Full Code Here

      case INTEGER:
        return new IntegerAttribute();
      case LONG:
        return new LongAttribute();
      case SHORT:
        return new ShortAttribute();
      case STRING:
        return new StringAttribute();
      case URL:
        return new UrlAttribute();
      default:
View Full Code Here

    private Attribute attribute;

    private AttributeInfo info;

    AttributeInfoPair(String name, String label, short value) {
      this.attribute = new ShortAttribute(value);
      this.info = new PrimitiveAttributeInfo(name, label, PrimitiveType.SHORT);
    }
View Full Code Here

        PrimitiveAttribute<?> p = (PrimitiveAttribute<?>) attribute;
        switch (p.getType()) {
          case BOOLEAN:
            return new BooleanAttribute();
          case SHORT:
            return new ShortAttribute();
          case INTEGER:
            return new IntegerAttribute();
          case LONG:
            return new LongAttribute();
          case FLOAT:
View Full Code Here

TOP

Related Classes of org.geomajas.layer.feature.attribute.ShortAttribute

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.