XML DOM: "lax" enums?
In Idea's XML binding framework: Is there any way to specify string attributes that know about common values, but allow any value.
This is an extract of the xsd:
]]>
请先登录再写评论。
What do you mean by "know"? Doesn't GenericAttributeValue satisfy you? "Stephen Friedrich" ]]> wrote in message
news:22841159.1159262102197.JavaMail.itn@is.intellij.net...
I was hoping for code-completion in attribute value.
Using String is my current workaround.
In general: What is the benefit of using enums/NamedEnums in DOM interfaces?
>I was hoping for code-completion in attribute value.
Currently I don't see any way. I can suggest to file a request.
NamedEnum is just a named enum :). It has corresponding method. If your XML
enum variant isn't Java identifier, use it, otherwise these names will just
be equal to your enum constants names.
It's not that important.
I do understand that.
What I don't really understand is what difference it makes in practice wether I use
GenericDomValue getType(); or GenericDomValue]]> getType();
The difference is precisely your problem. The values not present in TypeEnum
will be highlighted as incorrect.
"Stephen Friedrich" <no_mail@jetbrains.com> wrote in message
news:8719929.1159266535294.JavaMail.itn@is.intellij.net...
>> Currently I don't see any way. I can suggest to file a request.
>
>> NamedEnum is just a named enum :). It has corresponding method. If your
>> XML
>> enum variant isn't Java identifier, use it, otherwise these names will
>> just
>> be equal to your enum constants names.
>
I came across a couple more of these situations, so I filed a Jira request:
http://www.jetbrains.net/jira/browse/IDEA-9542