Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes xml schema like validation check Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "xml schema like validation check" Watch "xml schema like validation check" New topic
Author

xml schema like validation check

Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
Hi All,

Our current application is exposed to be triggered by external apps.
The input for the same being a custom complex java object. We validate this input java object for null checks and empty strings.
Now the check happens in a very generic fashion. What we want to develop is a routine something how xml schema validation happens where in the error message back to the invoking application we can give elaborate details which attribute was null or which string attribute was empty.
Pardon me if I sound dense.
Since the checks we have in java are generic I only manage to return a message back to the calling app like "Invalid input" but what I want to acheive is "String str is empty" or "Object xyz is null" as part of the return error message.
I was wondering in the generic check how can we introspect the attribute name. What i eventually want to do is list out all erroneous attributes and list down the error description for each and send them back to the calling app.

Do let me know your thoughts

Uday
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36513
    
  16
Not a beginner's topic. Moving.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36513
    
  16
You don't sound dense; this is however too complicated a question for the beginner's forum.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Uday,

Have you perchance had a look at how Apache Command Line Interface project deals with this? Look up their concept of validators and you may see some ideas you like.

In terms of introspection, I assume you've looked at the Reflections API?

Hope that helps steer you in the right direction!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xml schema like validation check
 
Similar Threads
Proper way to show error page
object validation and messages
Validation in struts
application design questions.
Get rid of line numbers