public void fromJSONObject()

in src/main/java/org/apache/sling/feature/extension/apiregions/api/config/ConfigurableEntity.java [92:123]


	public void fromJSONObject(final JsonObject jsonObj) throws IOException {
        super.fromJSONObject(jsonObj);
        try {
            JsonValue val = this.getAttributes().remove(InternalConstants.KEY_PROPERTIES);
            if ( val != null ) {
                for(final Map.Entry<String, JsonValue> innerEntry : val.asJsonObject().entrySet()) {
					final PropertyDescription prop = new PropertyDescription();
					prop.fromJSONObject(innerEntry.getValue().asJsonObject());
                    if ( this.getPropertyDescriptions().put(innerEntry.getKey(), prop) != null )  {
                        throw new IOException("Duplicate key for property description (keys are case-insensitive) : ".concat(innerEntry.getKey()));
                    }
                }
            }            
			final String modeVal = this.getString(InternalConstants.KEY_MODE);
			if ( modeVal != null ) {
                this.setMode(Mode.valueOf(modeVal.toUpperCase()));				
			}
            final String regionVal = this.getString(InternalConstants.KEY_REGION);
            if ( regionVal != null ) {
                this.setRegion(Region.valueOf(regionVal.toUpperCase()));				
            }
			this.setAllowAdditionalProperties(this.getBoolean(InternalConstants.KEY_ALLOW_ADDITIONAL_PROPERTIES, this.isAllowAdditionalProperties()));
            val = this.getAttributes().remove(InternalConstants.KEY_INTERNAL_PROPERTIES);
            if ( val != null ) {
                for(final JsonValue v : val.asJsonArray()) {
                    this.getInternalPropertyNames().add(getString(v));
                }
            }
        } catch (final JsonException | IllegalArgumentException e) {
            throw new IOException(e);
        }
	}