Package com.volantis.shared.metadata.type

Examples of com.volantis.shared.metadata.type.ChoiceDefinition


                            value,
                            null,
                            "Null choice name."));
                }
            } else {
                final ChoiceDefinition choiceDefinition =
                    getChoiceDefinition(choiceName);
               
                if (choiceDefinition == null) {
                    // No choice definition for selected choice name is an error.
                    errors.add(new VerificationError(
                            VerificationError.TYPE_UNEXPECTED_VALUE,
                            path,
                            value,
                            null,
                            "Choice '" + choiceName + "' is not expected here."));
                } else {
                    // Verify choice value against its type.
                    Collection valueErrors =
                        choiceDefinition.getType().verify(choiceValue.getValue());
                   
                    errors.addAll(valueErrors);
                }
            }
        }
View Full Code Here


     *
     * @param name The name of the choice.
     * @return The choice definition.
     */
    private ChoiceDefinition getChoiceDefinition(String name) {
        ChoiceDefinition choiceDefinition = null;
       
        Iterator iterator = choiceDefinitions.iterator();
       
        while (iterator.hasNext()) {
            ChoiceDefinition choiceDefinitionCandidate =
                (ChoiceDefinition) iterator.next();
           
            if (choiceDefinitionCandidate.getName().equals(name)) {
                choiceDefinition = choiceDefinitionCandidate;
            }
        }
               
        return choiceDefinition;
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.type.ChoiceDefinition

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.