Package com.ibm.fhir.config.mock
Class MockPropertyGroup
- java.lang.Object
-
- com.ibm.fhir.config.PropertyGroup
-
- com.ibm.fhir.config.mock.MockPropertyGroup
-
public class MockPropertyGroup extends PropertyGroup
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.fhir.config.PropertyGroup
PropertyGroup.PropertyEntry
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.config.PropertyGroup
jsonObj, PATH_ELEMENT_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description MockPropertyGroup(javax.json.JsonObject jsonObj)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.gson.JsonObject
getGsonSubGroup(com.google.gson.JsonObject gsonObj, String[] pathElements)
Retrieves the JsonObject that contains the property associated with the specified path elements.MockPropertyGroup
getPropertyGroup(String propertyName)
Returns a PropertyGroup associated with the specified property.void
setProperty(String propertyName, Object value)
Sets the specified property to the specified value.protected com.google.gson.JsonObject
toGson(javax.json.JsonObject jsonObj)
protected javax.json.JsonObject
toJson(com.google.gson.JsonObject gsonObj)
-
Methods inherited from class com.ibm.fhir.config.PropertyGroup
convertJsonValue, getArrayProperty, getBooleanProperty, getBooleanProperty, getDoubleProperty, getDoubleProperty, getIntProperty, getIntProperty, getJsonObj, getJsonValue, getPathElements, getProperties, getPropertySubGroup, getStringListProperty, getStringProperty, getStringProperty, setJsonObj, toString
-
-
-
-
Method Detail
-
getPropertyGroup
public MockPropertyGroup getPropertyGroup(String propertyName)
Description copied from class:PropertyGroup
Returns a PropertyGroup associated with the specified property.- Overrides:
getPropertyGroup
in classPropertyGroup
- Parameters:
propertyName
- a hierarchical property name (e.g. "level1/level2/level3") that refers to a property group.- Returns:
- a PropertyGroup that holds the sub-structure associated with the specified property.
-
setProperty
public void setProperty(String propertyName, Object value)
Sets the specified property to the specified value. The value must be an instance of String, Boolean, or Number.- Parameters:
propertyName
- a hierarchical property name (e.g. "level1/level2/myProperty")value
- the value to set
-
getGsonSubGroup
protected com.google.gson.JsonObject getGsonSubGroup(com.google.gson.JsonObject gsonObj, String[] pathElements)
Retrieves the JsonObject that contains the property associated with the specified path elements. If a certain property subgroup doesn't exist, then it is created.- Parameters:
gsonObj
- the root JsonObject to start the search inpathElements
- the various elements that make up the hierarchical property name.- Returns:
- a JsonObject that will contain the specified property
-
toJson
protected javax.json.JsonObject toJson(com.google.gson.JsonObject gsonObj) throws javax.json.JsonException
- Throws:
javax.json.JsonException
-
toGson
protected com.google.gson.JsonObject toGson(javax.json.JsonObject jsonObj)
-
-