Package org.geomajas.layer

Examples of org.geomajas.layer.LayerException


  }

  public Object read(String featureId) throws LayerException {
    synchronized (featuresById) {
      if (!featuresById.containsKey(featureId)) {
        throw new LayerException(ExceptionCode.LAYER_MODEL_FEATURE_NOT_FOUND, featureId);
      } else {
        return featuresById.get(featureId);
      }
    }
  }
View Full Code Here


        try {
          attributes.add(converterService.toDto(object, attributeInfo));
        } catch (LayerException le) {
          throw le; // assure LayerException is not wrapped unnecessarily
        } catch (GeomajasException e) {
          throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM, attributeName);
        }
      }
    }
    return attributes;
  }
View Full Code Here

        features.add(toDto(it.next()));
      }
    } catch (LayerException le) {
      throw le;
    } catch (Exception e) {
      throw new LayerException(e, ExceptionCode.UNEXPECTED_PROBLEM);
    } finally {
      if (null != stream) {
        try {
          stream.close();
        } catch (IOException ioe) {
View Full Code Here

          namedLayerInfo = choice.getNamedLayer();
        }
      }
    }
    if (namedLayerInfo == null) {
      throw new LayerException(ExceptionCode.INVALID_SLD, styledLayerDescriptorInfo.getName(), layerName);
    }

    UserStyleInfo userStyleInfo = null;
    for (NamedLayerInfo.ChoiceInfo choice : namedLayerInfo.getChoiceList()) {
      // we only support user styles, pick the right name or the first
      if (choice.ifUserStyle()) {
        if (styleName != null) {
          if (styleName.equals(choice.getUserStyle().getName())) {
            userStyleInfo = choice.getUserStyle();
            break;
          }
        }
        if (userStyleInfo == null) {
          userStyleInfo = choice.getUserStyle();
        }
      }
    }
    if (userStyleInfo == null) {
      throw new LayerException(ExceptionCode.INVALID_SLD, styledLayerDescriptorInfo.getName(), layerName);
    }

    NamedStyleInfo namedStyleInfo = convert(userStyleInfo, featureInfo);
    if (namedStyleInfo.getName() == null) {
      namedStyleInfo.setName(styleName);
View Full Code Here

                break;
              case ONE_TO_MANY:
                value = new LazyOneToManyAttribute(featureModel, featureBean, name);
                break;
              default:
                throw new LayerException(ExceptionCode.UNEXPECTED_PROBLEM,
                    "Coding error, not all AssociationType options are covered");
            }
          } else {
            PrimitiveType type = ((PrimitiveAttributeInfo) attribute).getType();
            value = new LazyPrimitiveAttribute(type, featureModel, featureBean, name);
View Full Code Here

        return new FeatureEntity(new FeatureBean());
      }
      if (dataSourceName.equals(ManyToOneAttributeBean.class.getName())) {
        return new ManyToOneEntity(new ManyToOneAttributeBean());
      }
      throw new LayerException();
    }
View Full Code Here

    public void setAttribute(String name, Object value) throws LayerException {
      try {
        BeanUtils.setProperty(bean, name, value);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here

    public Object getAttribute(String name) throws LayerException {
      try {
        return BeanUtils.getProperty(bean, name);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here

    public void setAttribute(String name, Object value) throws LayerException {
      try {
        BeanUtils.setProperty(bean, name, value);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here

    public Object getAttribute(String name) throws LayerException {
      try {
        return BeanUtils.getProperty(bean, name);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.LayerException

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.