|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.finra.jtaf.core.parsing.helpers.AttributeHelper
public class AttributeHelper
Helper class to fetch attributes of an element.
Constructor Summary | |
---|---|
AttributeHelper(Element e)
Collect the attributes, make sure their names are all cast to lowercase, and throw an exception if there are name collisions. |
Method Summary | |
---|---|
boolean |
containsKey(String key)
Search for the given key, ignoring case |
boolean |
containsValue(String value)
Search for the given value |
Set<Map.Entry<String,String>> |
entrySet()
|
Set<String> |
getCollisions()
|
Map<String,String> |
getMap()
Make sure you don't modify this return value |
String |
getOptionalString(String key)
Search for the given key, ignoring case |
int |
getRequiredInteger(String key)
Ensures that the attribute is a properly-formatted integer |
String |
getRequiredString(String key)
Throws an exception if the requested attribute is undefined or an empty string |
String |
getStringOrDefault(String key,
String defaultValue)
If the requested attribute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeHelper(Element e)
qName
- attributes
- Method Detail |
---|
public final Set<String> getCollisions()
public Set<Map.Entry<String,String>> entrySet()
public final Map<String,String> getMap()
public boolean containsKey(String key)
key
-
public boolean containsValue(String value)
value
-
public String getRequiredString(String key) throws MissingAttributeException
key
-
MissingAttributeException
public String getOptionalString(String key)
key
-
public final String getStringOrDefault(String key, String defaultValue)
key
- defaultValue
-
public final int getRequiredInteger(String key) throws MissingAttributeException, AttributeFormatException
key
-
MissingAttributeException
AttributeFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |