Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In eLandings, users create landing reports. Each landing report requires the user to define what type of gear species was used caught while fishing. eLandings has a list of accepted gear species codes. Users are able to type in the code quicklyspecies code quicker than typing in the full name of the species. eLanding can then check the gear species code list to see if the the user entered a gear species code that is recognized by eLandings.

...

Code Block
//Create a generatic unmarshaller

javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance("generated");
javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();

       
//Read in the species.xml file and parse it into a Codes object.
FileInputStream input = new FileInputStream("species.xml" );
Codes codes =(Codes)unmarshaller.unmarshal(input);
      

//Get the list of species contained within the codes object, iterate over the list and display the species codes and names found therein.
List<SpeciesDef> species = codes.getSpeciesDef();
for(SpeciesDef speciesDef:species){
   System.out.println("Species "+speciesDef.getSpecies().getName()+" -- "+speciesDef.getSpecies().getValue().toString());
}

You now have a list of all the species codes that eLandings currently accepts. This approach can be used to load statareas, gear codes, chill types, etc.

Be aware that every year, a few minor changes are made to these code files.