Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22951 > unrolled thread

regexp(ing) Backus-Naurish expressions ...

Started byqwertmonkey@syberianoutpost.ru
First post2013-03-14 08:00 +0000
Last post2013-03-14 21:08 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  regexp(ing) Backus-Naurish expressions ... qwertmonkey@syberianoutpost.ru - 2013-03-14 08:00 +0000
    Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-14 21:08 -0400

#22951 — regexp(ing) Backus-Naurish expressions ...

Fromqwertmonkey@syberianoutpost.ru
Date2013-03-14 08:00 +0000
Subjectregexp(ing) Backus-Naurish expressions ...
Message-ID<khs03r$18i$1@speranza.aioe.org>
Arne Vajhøj schrieb:
>
>>> I would do it as:
>>> - switch from properties to XML
>>> - define a schema for the XML with strict restrictions on data
>>> - let the application parse that with a validating parser and
>>>     read it into some config object, this will ensure that required
>>>     information is there and that the data types are correct
>>> - let the application apply business validation rules in Java code
>>>     on the config objects - this will ensure that the various
>>>     information is consistent
>> ~
>>   Arne, what do you specifically mean when you say "read it into some
>> config object"? Using JAXB? AFAIK JAXB needs source (re)compilation in
>> Android:
>
>JAXB is on way to get from XML to Java objects.
>
>But there are plenty of other. W3C DOM, SAX, StAX, JDOM etc.. I would
>expect some of them to be available on Android. 
~ 
 My favorite way to go about this is using SAX with validation and custom
handlers which entend an abstract class, so you can load and use them
as some sort of array of command objects via an index
~ 
>Anything that can be represented in a properties file should be
>possible to represent in a XML file. And most likely in a more
>structured way. 
~ 
 yes, but we are talking users here and the similarity between command-line
options and properties files is obvious compared to xml
~ 
 lbrtchx

[toc] | [next] | [standalone]


#22955

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-03-14 21:08 -0400
Message-ID<5142747a$0$32111$14726298@news.sunsite.dk>
In reply to#22951
On 3/14/2013 4:00 AM, qwertmonkey@syberianoutpost.ru wrote:
> Arne Vajhøj schrieb:
>>
>>>> I would do it as:
>>>> - switch from properties to XML
>>>> - define a schema for the XML with strict restrictions on data
>>>> - let the application parse that with a validating parser and
>>>>      read it into some config object, this will ensure that required
>>>>      information is there and that the data types are correct
>>>> - let the application apply business validation rules in Java code
>>>>      on the config objects - this will ensure that the various
>>>>      information is consistent
>>> ~
>>>    Arne, what do you specifically mean when you say "read it into some
>>> config object"? Using JAXB? AFAIK JAXB needs source (re)compilation in
>>> Android:
>>
>> JAXB is on way to get from XML to Java objects.
>>
>> But there are plenty of other. W3C DOM, SAX, StAX, JDOM etc.. I would
>> expect some of them to be available on Android.
> ~
>   My favorite way to go about this is using SAX with validation and custom
> handlers which entend an abstract class, so you can load and use them
> as some sort of array of command objects via an index
> ~
>> Anything that can be represented in a properties file should be
>> possible to represent in a XML file. And most likely in a more
>> structured way.
> ~
>   yes, but we are talking users here and the similarity between command-line
> options and properties files is obvious compared to xml

If it is non-IT people, then that is an argument for properties
files over XML.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web