Package org.geomajas.layer.feature

Examples of org.geomajas.layer.feature.Attribute


    try {
      Map<String, Attribute> attribs = new HashMap<String, Attribute>();
      for (AttributeInfo attribute : getFeatureInfo().getAttributes()) {
        String name = attribute.getName();
        if (!name.equals(getGeometryAttributeName())) {
          Attribute value = getAttribute(feature, name);
          attribs.put(name, value);
        }
      }
      return attribs;
    } catch (Exception e) {
View Full Code Here


    feature.attributesLoaded = attributesLoaded;
    return feature;
  }

  public Object getAttributeValue(String attributeName) {
    Attribute attribute = getAttributes().get(attributeName);
    if (attribute != null) {
      return attribute.getValue();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }
 
  public void setBooleanAttribute(String name, Boolean value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof BooleanAttribute)) {
      throw new IllegalStateException("Cannot set boolean value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((BooleanAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((BooleanAttribute) attribute).setValue(value);
  }

  public void setCurrencyAttribute(String name, String value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof CurrencyAttribute)) {
      throw new IllegalStateException("Cannot set currency value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((CurrencyAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((CurrencyAttribute) attribute).setValue(value);
  }

  public void setDateAttribute(String name, Date value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof DateAttribute)) {
      throw new IllegalStateException("Cannot set date value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((DateAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((DateAttribute) attribute).setValue(value);
  }

  public void setDoubleAttribute(String name, Double value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof DoubleAttribute)) {
      throw new IllegalStateException("Cannot set double value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((DoubleAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((DoubleAttribute) attribute).setValue(value);
  }

  public void setFloatAttribute(String name, Float value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof FloatAttribute)) {
      throw new IllegalStateException("Cannot set float value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((FloatAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((FloatAttribute) attribute).setValue(value);
  }

  public void setImageUrlAttribute(String name, String value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof ImageUrlAttribute)) {
      throw new IllegalStateException("Cannot set imageUrl value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((ImageUrlAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((ImageUrlAttribute) attribute).setValue(value);
  }

  public void setIntegerAttribute(String name, Integer value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof IntegerAttribute)) {
      throw new IllegalStateException("Cannot set integer value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((IntegerAttribute) attribute).setValue(value);
  }
View Full Code Here

    }
    ((IntegerAttribute) attribute).setValue(value);
  }

  public void setLongAttribute(String name, Long value) {
    Attribute attribute = getAttributes().get(name);
    if (!(attribute instanceof LongAttribute)) {
      throw new IllegalStateException("Cannot set boolean value on attribute with different type, " +
          attribute.getClass().getName() + " setting value " + value);
    }
    ((LongAttribute) attribute).setValue(value);
  }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.feature.Attribute

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.