Java解析配置文件的思路?
大块:
# this file is a file
<DefaultPrinter name>
...
</Printer>
<Printer name>
...
AllowUser foo_user
AllowUser @bar_group
</Printer>
....
其中一项:
<Printer Deskjet_1010>
UUID urn:uuid:a451687d-88d6-3881-575c-c8d6e920d556
Info Automatically setup by HPLIP
MakeModel HP Deskjet 1010 Series, hpcups 3.13.11
DeviceURI hp:/usb/Deskjet_1010_series?serial=CN39I18M1805S8
State Stopped
StateMessage Unplugged or turned off
StateTime 1393841123
Reason paused
Type 36876
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
把把大项和小项分解出来。最后要达到的是combo box,选中大项的名字,下面的变量值变成对应的值。(初学java请各位指点思路)
------解决方案--------------------说的清楚一点。看不懂
------解决方案--------------------记录配置文件大小,定时检查不就可以了么