Package org.structr.common.error

Examples of org.structr.common.error.FrameworkException


        try {
          return (T) Enum.valueOf(enumType, source.toString());

        } catch (Throwable t) {

          throw new FrameworkException(declaringClass.getSimpleName(), new ValueToken(EnumProperty.this, enumType.getEnumConstants()));
        }
      }

      return null;
View Full Code Here


          return new SimpleDateFormat(format).parse(source);

        } catch (Throwable t) {

          throw new FrameworkException(declaringClass.getSimpleName(), new DateFormatToken(DateProperty.this));

        }

      }
View Full Code Here

  @Override
  public void setGroupedProperties(SecurityContext securityContext, PropertyMap source, GraphObject destination) throws FrameworkException {

    if (source.containsKey(nullValuesOnlyProperty)) {
      throw new FrameworkException("base", new ReadOnlyPropertyToken(nullValuesOnlyProperty));
    }
   
    if (source.isEmpty()) {

      destination.setProperty(nullValuesOnlyProperty, true);
View Full Code Here

    final String fileName = (String)attributes.get("file");
    final String source   = (String)attributes.get("source");
    final String url      = (String)attributes.get("url");

    if (fileName == null && source == null && url == null) {
      throw new FrameworkException(422, "Please supply file, url or source parameter.");
    }

    if (fileName != null && source != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    if (fileName != null && url != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    if (url != null && source != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    try {

      if (fileName != null) {
View Full Code Here

    return value;
  }

  @Override
  public void setProperty(SecurityContext securityContext, GraphObject obj, T value) throws FrameworkException {
    throw new FrameworkException(obj.getClass().getSimpleName(), new ReadOnlyPropertyToken(this));
  }
View Full Code Here

            + "This is often due to wrong modeling, or you should consider creating a uniquness constraint for " + type.getName(), size);

          break;
      }

      throw new FrameworkException(type.getSimpleName(), new PropertiesNotFoundToken(AbstractNode.base, attributes));
    }
   
    return null;
  }
View Full Code Here

  private T getTypedResult(Result<T> result, Class<T> type) throws FrameworkException {
   
    GraphObject obj = result.get(0);

    if (!type.isAssignableFrom(obj.getClass())) {
      throw new FrameworkException(type.getSimpleName(), new TypeToken(AbstractNode.base, type.getSimpleName()));
    }

    return result.get(0);
  }
View Full Code Here

    final String fileName = (String)attributes.get("file");
    final String source   = (String)attributes.get("source");
    final String url      = (String)attributes.get("url");

    if (fileName == null && source == null && url == null) {
      throw new FrameworkException(422, "Please supply file, url or source parameter.");
    }

    if (fileName != null && source != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    if (fileName != null && url != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    if (url != null && source != null) {
      throw new FrameworkException(422, "Please supply only one of file, url or source.");
    }

    try {

      if (fileName != null) {
View Full Code Here

      }
    }

    if (fileName == null) {

      throw new FrameworkException(400, "Please specify sync file.");
    }

    if ("export".equals(mode)) {

      exportToFile(graphDb, fileName, true);

    } else if ("exportDb".equals(mode)) {

      exportToFile(graphDb, fileName, false);

    } else if ("import".equals(mode)) {

      importFromFile(graphDb, securityContext, fileName, doValidation);

    } else {

      throw new FrameworkException(400, "Please specify sync mode (import|export).");
    }
  }
View Full Code Here

      tx.success();

    } catch (Throwable t) {

      throw new FrameworkException(500, t.getMessage());
    }

  }
View Full Code Here

TOP

Related Classes of org.structr.common.error.FrameworkException

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.