fiftyone.device.example.illustration
Class MetadataExample

java.lang.Object
  extended by fiftyone.device.example.illustration.MetadataExample
All Implemented Interfaces:
Closeable

public class MetadataExample
extends Object
implements Closeable

Example of listing properties and possible values from a Dataset

The example illustrates:

  1. Loading a memory-resident Pattern Dataset
      
          dataset = MemoryFactory.create(Shared.getLitePatternV32(), true);
      
      
  2. Enumerating properties contained in the dataset loaded
      
          for(Property property : dataset.getProperties()) {
      
      
  3. Accessing description for each property.
      
          property.getDescription();
      
      
  4. Enumerating values that the property may have
      
          for (Value value : property.getValues().getAll()) {
      
      
  5. Accessing description of each value
      
          if (value.getDescription() != null) {
      
      
The 51 Degrees Property Dictionary contains a description of each of the properties and the editions in which they are available.

main assumes it is being run with a working directory at root of project or of this module.


Constructor Summary
MetadataExample()
          Creates a new Dataset using memory factory which creates a memory-resident representation of data.
 
Method Summary
 void close()
          Don't forget to close datasets when you are done with them.
 void listProperties()
          Lists all properties available in provided data file and all possible values for each property.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataExample

public MetadataExample()
                throws IOException
Creates a new Dataset using memory factory which creates a memory-resident representation of data.

Throws:
IOException - if there was a problem reading from the data file.
Method Detail

listProperties

public void listProperties()
                    throws IOException
Lists all properties available in provided data file and all possible values for each property.

Throws:
IOException - if there was a problem reading from the data file.

close

public void close()
           throws IOException
Don't forget to close datasets when you are done with them.

Specified by:
close in interface Closeable
Throws:
IOException - if there was a problem accessing the data file.

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2017 51Degrees. All rights reserved.