Answer the question
In order to leave comments, you need to log in
How to properly organize a SAX parser in Java?
There is an xml document:
<tariffs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tarasiuk.by/task02"
xsi:schemaLocation="https://tarasiuk.by/task02 Tariffs.xsd">
<mobile-connection id="T01">
<tariff-information>
<tariff-name>Unlimited</tariff-name>
<description>Unlimited internet and unlimited calls.</description>
<date-creation>2021-05-08</date-creation>
<time-creation>08:00:00</time-creation>
</tariff-information>
<operator country="BY">
<simple-name>MTS</simple-name>
<full-name>Mobile TeleSystems JLLC</full-name>
</operator>
<parameters>
<count-favorite-numbers>3</count-favorite-numbers>
<tariffication>twelve seconds</tariffication>
</parameters>
<default-price currency="BYN">
<connection-to-tariff>00.00</connection-to-tariff>
<payroll>15.78</payroll>
<send-sms>1.0</send-sms>
</default-price>
<call-price currency="BYN">
<on-mobile-phone>
<inside-operator>0.05</inside-operator>
<outside-operator>1.15</outside-operator>
</on-mobile-phone>
<on-landline-phone>2.00</on-landline-phone>
</call-price>
</mobile-connection>
<mobile-internet id="T02">
<tariff-information>
<tariff-name>Unlimited</tariff-name>
<description>Unlimited internet and unlimited calls.</description>
<date-creation>2021-05-08</date-creation>
<time-creation>08:00:00</time-creation>
</tariff-information>
<operator country="BY">
<simple-name>MTS</simple-name>
<full-name>Mobile TeleSystems JLLC</full-name>
</operator>
<parameters>
<count-favorite-numbers>3</count-favorite-numbers>
<tariffication>twelve seconds</tariffication>
</parameters>
<default-price currency="BYN">
<connection-to-tariff>00.00</connection-to-tariff>
<payroll>15.78</payroll>
<send-sms>1.0</send-sms>
</default-price>
<call-price currency="BYN">
<on-mobile-phone>
<inside-operator>0.05</inside-operator>
<outside-operator>1.15</outside-operator>
</on-mobile-phone>
<on-landline-phone>2.00</on-landline-phone>
</call-price>
<internet-price currency="BYN">
<up-one-gb>1.00</up-one-gb>
<over-one-gb>0.90</over-one-gb>
</internet-price>
</mobile-internet>
</tariffs>
Answer the question
In order to leave comments, you need to log in
Why do you need so many type classes? All *-price are stupid maps Strung, Float...
No need to wrap each tag in a class.
And if the file is healthy, then use Stax.
Personally, I don't see anything complicated.
Better yet combine with jaxb https://stackoverflow.com/questions/25643097/can-a...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question