There's an interaction with the other methods here. If the datatype is not
context-dependent, then the context arguments to checkValid, isValid and
createStreamingValidator methods should be allowed to be null. Otherwise a
null context argument should result in a NullPointerException. This
interaction makes it tricky to put the methods relating to the compatibility
spec on a separate interface, which would generally be a good thing.
The other thing that would be desirable for supporting the compatibility
spec would be:
static final int ID_TYPE_NULL = 0;
static final int ID_TYPE_ID = 1;
static final int ID_TYPE_IDREF = 2;
static final int ID_TYPE_IDREFS = 3;
int getIdType();
This allows the compatibility processor to avoid building in any knowledge
of particular datatype libraries.
While we're changing things, I think you should add
String getBaseUri()
to ValidationContext, since the spec explicitly includes a base URI in the
validation context.
I would also suggest in the javadoc comments
- Limiting line length to 80 chars
- Capitalizing the first character to a sentence.
James
----- Original Message -----
From: "Kohsuke KAWAGUCHI" <>
To: <>
Sent: Friday, September 07, 2001 1:38 AM
Subject: Datatype interface extension
>
> This is a SourceForge related issue.
>
>
> Since we've decided that we disallow context-dependend datatypes from
> attribute default values, the Datatype interface is needed to be
> extended to have the following method:
>
> boolean isContextDependent();
>
> This method should return false only if the datatype will never, ever need
> to access the context information.
>
> Since we are introducing the new method, it will break the backward
> compatibility. I assume it's OK at this moment to break backward
> compatibility, but I just want to make sure that nobody has serious
> problem with it.
>
>
> Throwing a ContextRequiredException seemed like a good idea but I now
> believe there is a problem with this approach. Namely, if you validate
> "abc" with the QName type without ValidationContext, it probably won't
> throw a ContextRequiredException.
>
>
> regards,
> --
> Kohsuke KAWAGUCHI +1 650 786 0721
> Sun Microsystems
>
>
> ----------------------------------------------------------------
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.oasis-open.org/ob/adm.pl>
>
>
>