org.openstreetmap.josm.io
Class Capabilities

java.lang.Object
  extended by org.openstreetmap.josm.io.Capabilities

public class Capabilities
extends java.lang.Object

Represents the server capabilities Example capabilites document: This class is used in conjunction with a very primitive parser and simply stuffs the each tag and its attributes into a hash of hashes, with the exception of the "blacklist" tag which gets a list of its own. The DOM hierarchy is disregarded.


Field Summary
private  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> capabilities
           
private  java.util.ArrayList<java.lang.String> imageryBlacklist
           
 
Constructor Summary
Capabilities()
           
 
Method Summary
 void clear()
           
 java.lang.String get(java.lang.String element, java.lang.String attribute)
           
 java.lang.Double getDouble(java.lang.String element, java.lang.String attribute)
          returns the value of configuration item in the capabilities as double value
 java.util.List<java.lang.String> getImageryBlacklist()
          returns the full list of blacklist regular expressions.
 java.lang.Long getLong(java.lang.String element, java.lang.String attribute)
           
 int getMaxChangesetSize()
          Returns the max number of objects in a changeset.
 boolean isDefined(java.lang.String element, java.lang.String attribute)
           
 boolean isOnImageryBlacklist(java.lang.String url)
          checks if the given URL is blacklisted by one of the of the regular expressions.
 void put(java.lang.String element, java.lang.String attribute, java.lang.String value)
           
 boolean supportsVersion(java.lang.String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capabilities

private java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> capabilities

imageryBlacklist

private java.util.ArrayList<java.lang.String> imageryBlacklist
Constructor Detail

Capabilities

public Capabilities()
Method Detail

isDefined

public boolean isDefined(java.lang.String element,
                         java.lang.String attribute)

get

public java.lang.String get(java.lang.String element,
                            java.lang.String attribute)

getDouble

public java.lang.Double getDouble(java.lang.String element,
                                  java.lang.String attribute)
                           throws java.lang.NumberFormatException
returns the value of configuration item in the capabilities as double value

Parameters:
element - the name of the element
attribute - the name of the attribute
Returns:
the value; null, if the respective configuration item doesn't exist
Throws:
java.lang.NumberFormatException - if the value is not a valid double

getLong

public java.lang.Long getLong(java.lang.String element,
                              java.lang.String attribute)

put

public void put(java.lang.String element,
                java.lang.String attribute,
                java.lang.String value)

clear

public void clear()

supportsVersion

public boolean supportsVersion(java.lang.String version)

getMaxChangesetSize

public int getMaxChangesetSize()
Returns the max number of objects in a changeset. -1 if either the capabilities don't include this parameter or if the parameter value is illegal (not a number, a negative number)

Returns:
the max number of objects in a changeset

isOnImageryBlacklist

public boolean isOnImageryBlacklist(java.lang.String url)
checks if the given URL is blacklisted by one of the of the regular expressions.


getImageryBlacklist

public java.util.List<java.lang.String> getImageryBlacklist()
returns the full list of blacklist regular expressions.



JOSM