Package org.jibx.schema.validation

Examples of org.jibx.schema.validation.ValidationContext.addError()


               
                // create and populate values on instance
                try {
                    ReflectionUtilities.applyKeyValueMap(map, obj);
                } catch (IllegalArgumentException e) {
                    vctx.addError(e.getMessage(), new ProblemLocation(ctx));
                }
            }
           
            // skip element and return unmarshalled decorator instance
            ctx.skipElement();
View Full Code Here


                       
                        // just create instance using no-argument constructor
                        return clas.newInstance();
                       
                    } catch (InstantiationException e) {
                        vctx.addError("Error creating instance of class " + cname + ": " + e.getMessage(),
                            new ProblemLocation(ctx));
                    } catch (IllegalAccessException e) {
                        vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                            new ProblemLocation(ctx));
                    }
View Full Code Here

                       
                    } catch (InstantiationException e) {
                        vctx.addError("Error creating instance of class " + cname + ": " + e.getMessage(),
                            new ProblemLocation(ctx));
                    } catch (IllegalAccessException e) {
                        vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                            new ProblemLocation(ctx));
                    }
                } else {
                    vctx.addError("Class " + cname + " does not implement the required NameConverter interface",
                        new ProblemLocation(ctx));
View Full Code Here

                    } catch (IllegalAccessException e) {
                        vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                            new ProblemLocation(ctx));
                    }
                } else {
                    vctx.addError("Class " + cname + " does not implement the required NameConverter interface",
                        new ProblemLocation(ctx));
                }
               
            } catch (ClassNotFoundException e) {
                vctx.addError("Unable to find class " + cname + " in classpath", new ProblemLocation(ctx));
View Full Code Here

                    vctx.addError("Class " + cname + " does not implement the required NameConverter interface",
                        new ProblemLocation(ctx));
                }
               
            } catch (ClassNotFoundException e) {
                vctx.addError("Unable to find class " + cname + " in classpath", new ProblemLocation(ctx));
            }
            return null;
        }
    }
   
View Full Code Here

        protected Object createInstance(String cname, UnmarshallingContext ctx) {
           
            // check class to be used for class decorator instance
            ValidationContext vctx = (ValidationContext)ctx.getUserContext();
            if (cname == null) {
                vctx.addError("Missing required 'class' attribute", new ProblemLocation(ctx));
            } else {
                try {
                   
                    // make sure the class implements the required interface
                    Class clas = SchemaRootBase.class.getClassLoader().loadClass(cname);
View Full Code Here

                    Class clas = SchemaRootBase.class.getClassLoader().loadClass(cname);
                    if (ClassDecorator.class.isAssignableFrom(clas)) {
                        try {
                            return clas.newInstance();
                        } catch (InstantiationException e) {
                            vctx.addError("Error creating instance of class " + cname + ": " + e.getMessage(),
                                new ProblemLocation(ctx));
                        } catch (IllegalAccessException e) {
                            vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                                new ProblemLocation(ctx));
                        }
View Full Code Here

                            return clas.newInstance();
                        } catch (InstantiationException e) {
                            vctx.addError("Error creating instance of class " + cname + ": " + e.getMessage(),
                                new ProblemLocation(ctx));
                        } catch (IllegalAccessException e) {
                            vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                                new ProblemLocation(ctx));
                        }
                    } else {
                        vctx.addError("Class " + cname + " does not implement the required ClassDecorator interface",
                            new ProblemLocation(ctx));
View Full Code Here

                        } catch (IllegalAccessException e) {
                            vctx.addError("Unable to access constructor for class " + cname + ": " + e.getMessage(),
                                new ProblemLocation(ctx));
                        }
                    } else {
                        vctx.addError("Class " + cname + " does not implement the required ClassDecorator interface",
                            new ProblemLocation(ctx));
                    }
                   
                } catch (ClassNotFoundException e) {
                    vctx.addError("Unable to find class " + cname + " in classpath", new ProblemLocation(ctx));
View Full Code Here

                        vctx.addError("Class " + cname + " does not implement the required ClassDecorator interface",
                            new ProblemLocation(ctx));
                    }
                   
                } catch (ClassNotFoundException e) {
                    vctx.addError("Unable to find class " + cname + " in classpath", new ProblemLocation(ctx));
                }
            }
            return null;
        }
    }
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.