public class AllProfiles extends Object implements Closeable
The example illustrates:
provider = new Provider(StreamFactory.create
(Shared.getLitePatternV32(), false));
Component hardwareComponent =
provider.dataSet.getComponent("HardwarePlatform");
Profile[] hardwareProfiles = hardwareComponent.getProfiles();
Values isMobile = profile.getValues("IsMobile");
A property may have multiple values. Helper methods convert the list of values into a Boolean, Double etc. For example:
isMobile.toBool();
MetadataExample.main(java.lang.String[]) for a listing of which properties
are available in the dataset supplied with this distribution.
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.
| Modifier and Type | Field and Description |
|---|---|
protected Component |
hardwareComponent |
protected static Profile[] |
hardwareProfiles |
protected static Property[] |
hardwareProperties |
String |
outputFilePath |
protected Provider |
provider |
| Constructor and Description |
|---|
AllProfiles()
Initialises the device detection Provider with the included Lite data
file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
Dataset by releasing data
file readers and freeing the data file from locks. |
protected String |
getValueForDisplay(Values values)
Match values may be null.
|
static void |
main(String[] args)
Instantiates this class and starts
run(java.lang.String) with default
parameters. |
void |
run(String outputFilename)
Writes a CSV file with all properties of all hardware devices in the
data set being used.
|
public String outputFilePath
protected final Provider provider
protected final Component hardwareComponent
protected static Profile[] hardwareProfiles
protected static Property[] hardwareProperties
public AllProfiles()
throws IOException
IOException - if there was a problem reading from the data file.public void run(String outputFilename) throws IOException
outputFilename - where to save the file with extra entries.IOException - if there was a problem reading from the data file.protected String getValueForDisplay(Values values)
values - a Values to renderpublic static void main(String[] args) throws IOException
run(java.lang.String) with default
parameters.args - command line arguments.IOException - if there was a problem accessing the data file.public void close()
throws IOException
Dataset by releasing data
file readers and freeing the data file from locks. This method should
only be used when the Dataset is no longer required, i.e. when
device detection functionality is no longer required, or the data file
needs to be freed.close in interface Closeableclose in interface AutoCloseableIOException - if there is a problem accessing the data file.Copyright © 2018 51Degrees. All rights reserved.