Examples of ValidationException


Examples of org.fcrepo.server.errors.ValidationException

     *             if the URL is malformed.
     */
    public static void validateURL(String url, String controlGroup)
            throws ValidationException {
        if (!(controlGroup.equalsIgnoreCase("M") || controlGroup.equalsIgnoreCase("E")) && url.startsWith("file:")) {
            throw new ValidationException(
                    "Malformed URL (file: not allowed for control group "
                            + controlGroup + ") " + url);
        }
        try {
            new URL(url);
        } catch (MalformedURLException e) {
            if (url.startsWith(DatastreamManagedContent.UPLOADED_SCHEME)) {
                return;
            }
            throw new ValidationException("Malformed URL: " + url, e);
        }
    }
View Full Code Here

Examples of org.geoserver.importer.ValidationException

            //parse the date format to ensure its legal
            try {
                this.datePattern.dateFormat();
            }
            catch(IllegalArgumentException iae) {
                throw new ValidationException("Invalid date parsing format",iae);
            }
        }
    }
View Full Code Here

Examples of org.geotools.validation.xml.ValidationException

    }
    //ensure that a plugin is present
    if (plugin == null) {
      String errorMsg = "Validation plugin '"+validation.getName()+"' not found"; //$NON-NLS-1$ //$NON-NLS-2$
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),"Problem Occurred", errorMsg); //$NON-NLS-1$
      ValidationPlugin.log(errorMsg, new ValidationException());
      return;
    }
    //create a testDTO containing the new validation test and args
    TestDTO newTest = new TestDTO();
    //set the name, desc, plugin, and args
View Full Code Here

Examples of org.graylog2.database.ValidationException

                    break;
                case "number":
                    try {
                        value = Integer.parseInt(String.valueOf(entry.getValue()));
                    } catch (NumberFormatException e) {
                        throw new ValidationException(entry.getKey(), e.getMessage());
                    }
                    break;
                case "boolean":
                    value = "true".equals(String.valueOf(entry.getValue()));
                    break;
View Full Code Here

Examples of org.hibernate.metamodel.ValidationException

  @Override
  public void validateJdbcTypes(JdbcCodes typeCodes) {
    // todo : better compatibility testing...
    if ( datatype.getTypeCode() != typeCodes.nextJdbcCde() ) {
      throw new ValidationException( "Mismatched types" );
    }
  }
View Full Code Here

Examples of org.jboss.dna.graph.session.ValidationException

                if (isRoot) {
                    try {
                        definition = nodeTypes().getRootNodeDefinition();
                    } catch (RepositoryException e) {
                        // Shouldn't really happen ...
                        throw new ValidationException(e.getMessage(), e);
                    }
                } else {
                    Name childName = node.getName();
                    Node<JcrNodePayload, JcrPropertyPayload> parent = node.getParent();
                    JcrNodePayload parentInfo = parent.getPayload();
                    int numExistingChildrenWithSameName = parent.getChildrenCount(childName);
                    // The children include this node, so we need to subtract one from the count so that the
                    // number of existing children is either 0 (if there are no other SNS nodes) or 1+
                    // (if there are at least 2 SNS nodes)
                    --numExistingChildrenWithSameName;
                    definition = nodeTypes().findChildNodeDefinition(parentInfo.getPrimaryTypeName(),
                                                                     parentInfo.getMixinTypeNames(),
                                                                     childName,
                                                                     primaryTypeName,
                                                                     numExistingChildrenWithSameName,
                                                                     false);
                }
            }
            if (definition == null) {
                String msg = JcrI18n.nodeDefinitionCouldNotBeDeterminedForNode.text(readable(node.getPath()),
                                                                                    workspaceName(),
                                                                                    sourceName());
                throw new ValidationException(msg);
            }

            // ------------------------------------------------------
            // Set the node's properties ...
            // ------------------------------------------------------
            boolean referenceable = false;

            // Start with the primary type ...
            JcrNodeType primaryType = nodeTypes().getNodeType(primaryTypeName);
            if (primaryType == null) {
                Path path = location.getPath();
                String msg = JcrI18n.missingNodeTypeForExistingNode.text(readable(primaryTypeName),
                                                                         readable(path),
                                                                         workspaceName(),
                                                                         sourceName());
                throw new ValidationException(msg);
            }
            if (primaryType.isNodeType(JcrMixLexicon.REFERENCEABLE)) referenceable = true;

            // The process the mixin types ...
            Property mixinTypesProperty = graphProperties.get(JcrLexicon.MIXIN_TYPES);
View Full Code Here

Examples of org.jboss.metadata.validation.ValidationException

      String localHome = smd.getLocalHome();

      // If remote, need home
      if ((remote != null && remote.trim().length() > 0) && (home == null || home.trim().length() == 0))
      {
         throw new ValidationException("EJB " + smd.getName() + " has defined EJB2.x remote component interface of "
               + remote + " but has no home; " + errorMessageSuffix);
      }

      // If home, need remote
      if ((home != null && home.trim().length() > 0) && (remote == null || remote.trim().length() == 0))
      {
         throw new ValidationException("EJB " + smd.getName() + " has defined EJB2.x home interface of " + home
               + " but has no remote component interface; " + errorMessageSuffix);
      }

      // If local, need localHome
      if ((local != null && local.trim().length() > 0) && (localHome == null || localHome.trim().length() == 0))
      {
         throw new ValidationException("EJB " + smd.getName() + " has defined EJB2.x local component interface of "
               + local + " but has no localHome; " + errorMessageSuffix);
      }

      // If localHome, need local
      if ((localHome != null && localHome.trim().length() > 0) && (local == null || local.trim().length() == 0))
      {
         throw new ValidationException("EJB " + smd.getName() + " has defined EJB2.x local home interface of "
               + localHome + " but has no local component interface; " + errorMessageSuffix);
      }

      // Log OK
      log.trace("Passed validation for " + errorCode);
View Full Code Here

Examples of org.jboss.seam.rest.validation.ValidationException

        if (violations.isEmpty()) {
            log.debug("Validation completed. No violations found.");
            return ctx.proceed();
        } else {
            log.debugv("Validation completed. {0} violations found.", violations.size());
            throw new ValidationException(violations);
        }
    }
View Full Code Here

Examples of org.jibx.runtime.ValidationException

                comp = (MenuComponent)comp.getChildren().get(0);
            }
        } else {
            comp = (MenuComponent)s_idMap.get(m_defaultId);
            if (comp == null) {
                throw new ValidationException("Target id value not defined",
                    this);
            }
        }
        return comp.getTarget();
    }
View Full Code Here

Examples of org.jvnet.hk2.config.ValidationException

     * @param value
     * @throws org.jvnet.hk2.config.ValidationException
     */
    public void validate(String value) throws ValidationException {
        if (value == null)
            throw new ValidationException("null value is not of type NonNegativeInteger");
        if (isTokenized(value))
            return; //a token is always valid
        try {
            long number = Long.parseLong(value);
            if (number < 0 || number > Integer.MAX_VALUE) {
                String msg = "value: " + number + " not applicable for NonNegativeInteger [0, " + Integer.MAX_VALUE + "] data type";
                throw new ValidationException(msg);
            }
        } catch(NumberFormatException e) {
            throw new ValidationException(e);
        }
    }
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.