Пример #1
0
 public List<String> getLodSetsNames() {
   List<String> names = new ArrayList<String>();
   for (LODSet l : this.lodSets) {
     names.add(l.getIdentifier());
   }
   return names;
 }
Пример #2
0
 public LODSet getLODSet(String identifier) {
   for (LODSet l : this.lodSets) {
     if (l.getIdentifier().equalsIgnoreCase(identifier)) {
       return l;
     }
   }
   return null;
 }
Пример #3
0
 public void endElement(String uri, String localName, String qName) throws SAXException {
   if (qName.equalsIgnoreCase("LOD")) {
     inLOD = false;
     if (!finIdentifier) {
       throw new SAXException("Don't fin a 'Identifier' definition.");
     }
     if (!finLODValue) {
       throw new SAXException("Don't fin a 'LODValue' definition.");
     }
     if (!finDefaultRange) {
       throw new SAXException("Don't fin a 'DefaultRange' definition.");
     }
     lodSet.addLOD(lod);
     setFind(false);
   }
 }
Пример #4
0
 public void characters(char ch[], int start, int length) throws SAXException {
   if (inIdentifierLODSet) {
     inIdentifierLODSet = false;
     lodSet.setIdentifier(new String(ch, start, length));
   }
   if (inTitle) {
     inTitle = false;
     lod.setTitle(new String(ch, start, length));
   }
   if (inAbstract) {
     inAbstract = false;
     lod.setAbstractTxt(new String(ch, start, length));
   }
   if (inIdentifier) {
     inIdentifier = false;
     lod.setIdentifier(new String(ch, start, length));
   }
   if (inLODValue) {
     inLODValue = false;
     try {
       int lodValue = Integer.valueOf(new String(ch, start, length));
       lod.setLodValue(lodValue);
     } catch (Exception e) {
       throw new SAXException(
           "Error parsing the 'LODValue' element " + new String(ch, start, length) + ".");
     }
   }
   if (inDefaultRange) {
     inDefaultRange = false;
     try {
       float defaultRange = Float.valueOf(new String(ch, start, length));
       lod.setDefaultRange(defaultRange);
     } catch (Exception e) {
       throw new SAXException(
           "Error parsing the 'DefaultRange' element " + new String(ch, start, length) + ".");
     }
   }
 }