Examples of DataException


Examples of com.cosmo.data.DataException

            xhtml.append(renderSection(group.getDetail(), ReportSection.DETAILGROUPROW, rs));
         }
      }
      catch (SQLException ex)
      {
         throw new DataException(ex.getMessage(), ex);
      }
      finally
      {
         DataAgent.closeResultSet(rs);
      }
View Full Code Here

Examples of com.sk89q.worldedit.data.DataException

        // Schematic tag
        NamedTag rootTag = nbtStream.readNamedTag();
        nbtStream.close();
        if (!rootTag.getName().equals("Schematic")) {
            throw new DataException("Tag \"Schematic\" does not exist or is not first");
        }

        CompoundTag schematicTag = (CompoundTag) rootTag.getTag();

        // Check
        Map<String, Tag> schematic = schematicTag.getValue();
        if (!schematic.containsKey("Blocks")) {
            throw new DataException("Schematic file is missing a \"Blocks\" tag");
        }

        // Get information
        short width = getChildTag(schematic, "Width", ShortTag.class).getValue();
        short length = getChildTag(schematic, "Length", ShortTag.class).getValue();
        short height = getChildTag(schematic, "Height", ShortTag.class).getValue();

        try {
            int originX = getChildTag(schematic, "WEOriginX", IntTag.class).getValue();
            int originY = getChildTag(schematic, "WEOriginY", IntTag.class).getValue();
            int originZ = getChildTag(schematic, "WEOriginZ", IntTag.class).getValue();
            origin = new Vector(originX, originY, originZ);
        } catch (DataException e) {
            // No origin data
        }

        try {
            int offsetX = getChildTag(schematic, "WEOffsetX", IntTag.class).getValue();
            int offsetY = getChildTag(schematic, "WEOffsetY", IntTag.class).getValue();
            int offsetZ = getChildTag(schematic, "WEOffsetZ", IntTag.class).getValue();
            offset = new Vector(offsetX, offsetY, offsetZ);
        } catch (DataException e) {
            // No offset data
        }

        // Check type of Schematic
        String materials = getChildTag(schematic, "Materials", StringTag.class).getValue();
        if (!materials.equals("Alpha")) {
            throw new DataException("Schematic file is not an Alpha schematic");
        }

        // Get blocks
        byte[] blockId = getChildTag(schematic, "Blocks", ByteArrayTag.class).getValue();
        byte[] blockData = getChildTag(schematic, "Data", ByteArrayTag.class).getValue();
View Full Code Here

Examples of com.sk89q.worldedit.world.DataException

            Map<String, Tag> values = rootTag.getValue();

            Tag t = values.get("id");
            if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Trap")) {
                throw new DataException("'Trap' tile entity expected");
            }

            List<CompoundTag> items = new ArrayList<CompoundTag>();
            for (Tag tag : NBTUtils.getChildTag(values, "Items", ListTag.class).getValue()) {
                if (!(tag instanceof CompoundTag)) {
                    throw new DataException("CompoundTag expected as child tag of Trap Items");
                }

                items.add((CompoundTag) tag);
            }
View Full Code Here

Examples of de.ailis.xadrian.exceptions.DataException

                    return true;
                }
            }
            catch (IOException e)
            {
                throw new DataException("Unable to read drag&drop data: " + e,
                    e);
            }
            catch (UnsupportedFlavorException e)
            {
                // Can't happen because we only process known flavours which
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<V>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<V>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          new DefaultFutureResult<V>((V) result.result().body().getValue("result")).setHandler(resultHandler);
        }
      }
    });
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<V>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<V>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          new DefaultFutureResult<V>((V) result.result().body().getValue("result")).setHandler(resultHandler);
        }
      }
    });
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<Boolean>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<Boolean>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          new DefaultFutureResult<Boolean>(result.result().body().getBoolean("result")).setHandler(resultHandler);
        }
      }
    });
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<Set<K>>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<Set<K>>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          JsonArray jsonKeys = result.result().body().getArray("result");
          if (jsonKeys != null) {
            Set<K> keys = new HashSet<>();
            for (Object key : jsonKeys) {
              keys.add((K) key);
            }
            new DefaultFutureResult<Set<K>>(keys).setHandler(resultHandler);
          } else {
            new DefaultFutureResult<Set<K>>(new DataException("Invalid response.")).setHandler(resultHandler);
          }
        }
      }
    });
  }
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<Collection<V>>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<Collection<V>>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          JsonArray jsonValues = result.result().body().getArray("result");
          if (jsonValues != null) {
            List<V> values = new ArrayList<>();
            for (Object value : jsonValues) {
              values.add((V) value);
            }
            new DefaultFutureResult<Collection<V>>(values).setHandler(resultHandler);
          } else {
            new DefaultFutureResult<Collection<V>>(new DataException("Invalid response.")).setHandler(resultHandler);
          }
        }
      }
    });
  }
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.DataException

                new DefaultFutureResult<Integer>(result.cause()).setHandler(resultHandler);
              }
            }
          });
        } else if (result.result().body().getString("status").equals("error")) {
          new DefaultFutureResult<Integer>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
        } else {
          new DefaultFutureResult<Integer>(result.result().body().getInteger("result")).setHandler(resultHandler);
        }
      }
    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.