Changeset 30738 in osm for applications/editors/josm/plugins/tageditor
- Timestamp:
- 2014-10-19T01:27:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java
r30737 r30738 26 26 /** 27 27 * This class manages a list of {@link TagSpecification}s. 28 * 28 * 29 29 * It also provides a method for reading a list of {@link TagSpecification}s from 30 30 * an XML file. 31 * 31 * 32 32 * @author Gubaer 33 33 * … … 63 63 * loads the tag specifications from the resource file given by 64 64 * {@link #RES_NAME_TAG_SPECIFICATIONS}. 65 * 65 * 66 66 * @return the list of {@link TagSpecification}s 67 67 * @throws Exception thrown, if an exception occurs … … 71 71 if (in == null) { 72 72 logger.log(Level.SEVERE, "failed to create input stream for resource '" + RES_NAME_TAG_SPECIFICATIONS + "'"); 73 }74 BufferedReader reader = new BufferedReader(new InputStreamReader(in));75 TagSpecifications spec= newTagSpecifications();76 spec.load(reader);77 reader.close();78 instance = spec; 79 73 return; 74 } 75 try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) { 76 TagSpecifications spec = new TagSpecifications(); 77 spec.load(reader); 78 instance = spec; 79 } 80 80 } 81 81 … … 97 97 /** 98 98 * loads the tag specifications from a specific reader 99 * 99 * 100 100 * @param in the reader to read from 101 101 * @throws Exception thrown, if an exception occurs … … 156 156 return items; 157 157 } 158 158 159 159 /** 160 160 * replies a list of {@see KeyValuePair}s for all {@see TagSpecification}s and 161 161 * {@see LableSpecification}s. 162 * 162 * 163 163 * @return the list 164 164 */ … … 178 178 /** 179 179 * The SAX handler for reading XML files with tag specifications 180 * 180 * 181 181 * @author gubaer 182 182 * … … 212 212 * parses a string value consisting of 'yes' or 'no' (exactly, case 213 213 * sensitive) 214 * 214 * 215 215 * @param value the string value 216 216 * @return true, if value is <code>yes</code>; false, if value is <code>no</code> … … 228 228 /** 229 229 * handles a start element with name <code>osm-tag-definitions</code> 230 * 230 * 231 231 * @param atts the XML attributes 232 232 * @throws SAXException … … 238 238 /** 239 239 * handles an end element with name <code>osm-tag-specifications</code> 240 * 240 * 241 241 * @throws SAXException 242 242 */ … … 247 247 /** 248 248 * handles a start element with name <code>tag</code> 249 * 249 * 250 250 * @param atts the XML attributes of the element 251 251 * @throws SAXException … … 285 285 /** 286 286 * handles a start element with name <code>label</code> 287 * 287 * 288 288 * @param atts the XML attributes 289 289 * @throws SAXException … … 311 311 /** 312 312 * handles an end element with name <code>label</code> 313 * 313 * 314 314 * @throws SAXException 315 315 */ … … 352 352 class ResourceEntityResolver implements EntityResolver { 353 353 354 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { 354 @Override 355 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { 355 356 if (systemId != null && systemId.endsWith(DTD)) { 356 357 InputStream stream = TagSpecifications.class.getResourceAsStream("/resources/"+DTD);
Note:
See TracChangeset
for help on using the changeset viewer.