Package org.apache.struts2.showcase.exception

Examples of org.apache.struts2.showcase.exception.CreateException


                return 1;
            } else {
                return 0;
            }
        } catch (Exception e) {
            throw new CreateException(e);
        }
    }
View Full Code Here


        }
    }

    public int delete( IdEntity object ) throws CreateException {
        if (object == null) {
            throw new CreateException("Cannot delete null object");
        }
        return delete(object.getClass(), object.getId());
    }
View Full Code Here

    }
  }

  public Serializable create(IdEntity object) throws CreateException {
    if (object == null) {
      throw new CreateException("Either given class or object was null");
    }
    if (object.getId() == null) {
      throw new CreateException("Cannot store object with null id");
    }
    if (get(object.getClass(), object.getId()) != null) {
      throw new DuplicateKeyException("Object with this id already exists.");
    }
    return intStore(object.getClass(), object).getId();
View Full Code Here

        return 1;
      } else {
        return 0;
      }
    } catch (Exception e) {
      throw new CreateException(e);
    }
  }
View Full Code Here

    }
  }

  public int delete(IdEntity object) throws CreateException {
    if (object == null) {
      throw new CreateException("Cannot delete null object");
    }
    return delete(object.getClass(), object.getId());
  }
View Full Code Here

        }
    }

    public Serializable create ( IdEntity object ) throws CreateException {
        if (object == null) {
            throw new CreateException("Either given class or object was null");
        }
        if (object.getId() == null) {
            throw new CreateException("Cannot store object with null id");
        }
        if (get(object.getClass(), object.getId()) != null) {
            throw new DuplicateKeyException("Object with this id already exists.");
        }
        return intStore(object.getClass(), object).getId();
View Full Code Here

                return 1;
            } else {
                return 0;
            }
        } catch (Exception e) {
            throw new CreateException(e);
        }
    }
View Full Code Here

        }
    }

    public int delete( IdEntity object ) throws CreateException {
        if (object == null) {
            throw new CreateException("Cannot delete null object");
        }
        return delete(object.getClass(), object.getId());
    }
View Full Code Here

        extraContext.put("parameters", parameterMap);
        extraContext.put(MODE_NAMESPACE_MAP, modeMap);

        extraContext.put(PHASE, phase);

        AttributeMap attrMap = new AttributeMap(extraContext);
        extraContext.put("attr", attrMap);

        return extraContext;
    }
View Full Code Here

   * @param t
   *            the exception
   * @return the exception as a string.
   */
  protected String toString(Throwable t) {
    FastByteArrayOutputStream bout = new FastByteArrayOutputStream();
    PrintWriter wrt = new PrintWriter(bout);
    t.printStackTrace(wrt);
    wrt.close();
    return bout.toString();
  }
View Full Code Here

TOP

Related Classes of org.apache.struts2.showcase.exception.CreateException

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.