You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2018/12/15 23:22:36 UTC

[incubator-tamaya-extensions] 04/05: Fixed doc issues.

This is an automated email from the ASF dual-hosted git repository.

anatole pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tamaya-extensions.git

commit 4cea87010878c6de552f23ecf7254e19c6d12ea6
Author: Anatole Tresch <at...@gmail.com>
AuthorDate: Sat Dec 15 23:07:36 2018 +0100

    Fixed doc issues.
---
 .../format/BaseFormatPropertySourceProvider.java   |  2 +-
 .../apache/tamaya/format/ConfigurationFormat.java  |  2 +-
 .../format/formats/IniConfigurationFormat.java     |  4 +--
 .../MappedConfigurationDataPropertySourceTest.java | 36 +++++++++++-----------
 .../org/apache/tamaya/json/JSONDataBuilder.java    | 14 ++++-----
 .../org/apache/tamaya/json/JSONVisitorTest.java    |  2 +-
 .../java/org/apache/tamaya/yaml/YAMLFormat.java    |  8 ++---
 7 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/modules/formats/base/src/main/java/org/apache/tamaya/format/BaseFormatPropertySourceProvider.java b/modules/formats/base/src/main/java/org/apache/tamaya/format/BaseFormatPropertySourceProvider.java
index b77949e..5abffe5 100644
--- a/modules/formats/base/src/main/java/org/apache/tamaya/format/BaseFormatPropertySourceProvider.java
+++ b/modules/formats/base/src/main/java/org/apache/tamaya/format/BaseFormatPropertySourceProvider.java
@@ -38,7 +38,7 @@ import java.util.logging.Logger;
  * Implementation of a {@link PropertySourceProvider} that reads configuration from some given resource paths
  * and using the given formats. The resource path are resolved as classpath resources. This can be changed by
  * overriding {@link #getPropertySources()}.
- * For each resource found the configuration formats passed getField a chance to read the resource, if they succeed the
+ * For each resource found the configuration formats passed value a chance to read the resource, if they succeed the
  * result is taken as the providers PropertySources to be exposed.
  */
 public abstract class BaseFormatPropertySourceProvider implements PropertySourceProvider {
diff --git a/modules/formats/base/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java b/modules/formats/base/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java
index eec8963..62a22fc 100644
--- a/modules/formats/base/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java
+++ b/modules/formats/base/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java
@@ -63,7 +63,7 @@ public interface ConfigurationFormat {
      * different levels of data:
      * <ul>
      *     <li>Only a <i>default</i> section is returned, since the configuration format does not support
-     *     hierarchies, e.g. a root {@link PropertyValue} with a number of direct getList.</li>
+     *     hierarchies, e.g. a root {@link PropertyValue} with a number of direct getValues.</li>
      *     <li>Hierarchical formats such as INI, XML, YAML and JSON can have both createObject mapped childs as well as arrays/createList
      *     childs. With {@link PropertyValue#toMap()} a default mapping to a property based representation is
      *     available.</li>
diff --git a/modules/formats/base/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java b/modules/formats/base/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java
index 3b1fbe6..500135c 100644
--- a/modules/formats/base/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java
+++ b/modules/formats/base/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java
@@ -85,13 +85,13 @@ public class IniConfigurationFormat implements ConfigurationFormat {
                         ObjectValue sectionPV = (ObjectValue)sections.computeIfAbsent(section,
                                 s -> PropertyValue.createObject(sectionName)
                         .setMeta(ConfigurationFormat.class.getName(), this));
-                        sectionPV.setField(key, value).setMeta("source", resource)
+                        sectionPV.setValue(key, value).setMeta("source", resource)
                                 .setMeta(ConfigurationFormat.class.getName(), this);
                     } else {
                         String finalSection = "default";
                         ObjectValue sectionBuilder = (ObjectValue)sections.computeIfAbsent(section,
                                 s -> PropertyValue.createObject(finalSection).setMeta("source", resource));
-                        sectionBuilder.setField(key, value).setMeta("source", resource)
+                        sectionBuilder.setValue(key, value).setMeta("source", resource)
                                 .setMeta(ConfigurationFormat.class.getName(), this);
                     }
                 }
diff --git a/modules/formats/base/src/test/java/org/apache/tamaya/format/MappedConfigurationDataPropertySourceTest.java b/modules/formats/base/src/test/java/org/apache/tamaya/format/MappedConfigurationDataPropertySourceTest.java
index aa2e88a..4cdf4f1 100644
--- a/modules/formats/base/src/test/java/org/apache/tamaya/format/MappedConfigurationDataPropertySourceTest.java
+++ b/modules/formats/base/src/test/java/org/apache/tamaya/format/MappedConfigurationDataPropertySourceTest.java
@@ -67,32 +67,32 @@ public class MappedConfigurationDataPropertySourceTest {
 //    @Test
 //    public void testGet() throws Exception {
 //        MappedConfigurationDataPropertySource ps = new MappedConfigurationDataPropertySource(createConfigurationData("test2"));
-//        assertEquals("aValue", ps.getField("a").createValue());
-//        assertNotNull(ps.getField("section1.sectionKey1").createValue());
-//        assertNotNull(ps.getField("section2.sectionKey1").createValue());
-//        assertNull(ps.getField("sectionKey1"));
+//        assertEquals("aValue", ps.getValue("a").createValue());
+//        assertNotNull(ps.getValue("section1.sectionKey1").createValue());
+//        assertNotNull(ps.getValue("section2.sectionKey1").createValue());
+//        assertNull(ps.getValue("sectionKey1"));
 //        ps = new MappedConfigurationDataPropertySource(createConfigurationDataNoDefault("test2"));
-//        assertEquals("sectionValue11", ps.getField("section1.sectionKey1").createValue());
-//        assertEquals("sectionValue21", ps.getField("section2.sectionKey1").createValue());
-//        assertNull(ps.getField("a"));
-//        assertNull(ps.getField("section1"));
+//        assertEquals("sectionValue11", ps.getValue("section1.sectionKey1").createValue());
+//        assertEquals("sectionValue21", ps.getValue("section2.sectionKey1").createValue());
+//        assertNull(ps.getValue("a"));
+//        assertNull(ps.getValue("section1"));
 //    }
 //
 //    @Test
 //    public void testGetProperties() throws Exception {
 //        MappedConfigurationDataPropertySource ps = new MappedConfigurationDataPropertySource(createConfigurationData("test3"));
 //        assertNotNull(ps.getProperties());
-//        assertEquals("aValue", ps.getProperties().getField("a").createValue());
-//        assertNotNull(ps.getProperties().getField("section1.sectionKey1"));
-//        assertNotNull(ps.getProperties().getField("section2.sectionKey1"));
-//        assertNull(ps.getProperties().getField("section1.sectionKey2"));
-//        assertNull(ps.getProperties().getField("section2.sectionKey2"));
-//        assertNull(ps.getProperties().getField("sectionKey1"));
-//        assertNull(ps.getProperties().getField("sectionKey2"));
+//        assertEquals("aValue", ps.getProperties().getValue("a").createValue());
+//        assertNotNull(ps.getProperties().getValue("section1.sectionKey1"));
+//        assertNotNull(ps.getProperties().getValue("section2.sectionKey1"));
+//        assertNull(ps.getProperties().getValue("section1.sectionKey2"));
+//        assertNull(ps.getProperties().getValue("section2.sectionKey2"));
+//        assertNull(ps.getProperties().getValue("sectionKey1"));
+//        assertNull(ps.getProperties().getValue("sectionKey2"));
 //        ps = new MappedConfigurationDataPropertySource(createConfigurationDataNoDefault("test3"));
 //        assertNotNull(ps.getProperties());
-//        assertEquals("sectionValue11", ps.getProperties().getField("section1.sectionKey1").createValue());
-//        assertEquals("sectionValue21", ps.getProperties().getField("section2.sectionKey1").createValue());
-//        assertNull(ps.getField("section1"));
+//        assertEquals("sectionValue11", ps.getProperties().getValue("section1.sectionKey1").createValue());
+//        assertEquals("sectionValue21", ps.getProperties().getValue("section2.sectionKey1").createValue());
+//        assertNull(ps.getValue("section1"));
 //    }
 }
\ No newline at end of file
diff --git a/modules/formats/json/src/main/java/org/apache/tamaya/json/JSONDataBuilder.java b/modules/formats/json/src/main/java/org/apache/tamaya/json/JSONDataBuilder.java
index 6c4e065..67283aa 100644
--- a/modules/formats/json/src/main/java/org/apache/tamaya/json/JSONDataBuilder.java
+++ b/modules/formats/json/src/main/java/org/apache/tamaya/json/JSONDataBuilder.java
@@ -48,26 +48,26 @@ class JSONDataBuilder {
         jsonObject.forEach((key,val) -> {
             switch(val.getValueType()) {
                 case FALSE:
-                    dataNode.setField(key, Boolean.FALSE.toString());
+                    dataNode.setValue(key, Boolean.FALSE.toString());
                     break;
                 case TRUE:
-                    dataNode.setField(key, Boolean.TRUE.toString());
+                    dataNode.setValue(key, Boolean.TRUE.toString());
                     break;
                 case NUMBER:
-                    dataNode.setField(key, val.toString());
+                    dataNode.setValue(key, val.toString());
                     break;
                 case STRING:
-                    dataNode.setField(key, ((JsonString) val).getString());
+                    dataNode.setValue(key, ((JsonString) val).getString());
                     break;
                 case NULL:
-                    dataNode.setField(key, null);
+                    dataNode.setValue(key, null);
                     break;
                 case OBJECT:
-                    ObjectValue oval = dataNode.setFieldObject(key);
+                    ObjectValue oval = dataNode.setObject(key);
                     addJsonObject((JsonObject)val, oval);
                     break;
                 case ARRAY:
-                    ListValue aval = dataNode.setFieldList(key);
+                    ListValue aval = dataNode.setList(key);
                     addArray((JsonArray)val, aval);
                     break;
                 default:
diff --git a/modules/formats/json/src/test/java/org/apache/tamaya/json/JSONVisitorTest.java b/modules/formats/json/src/test/java/org/apache/tamaya/json/JSONVisitorTest.java
index d3a4dbc..7183103 100644
--- a/modules/formats/json/src/test/java/org/apache/tamaya/json/JSONVisitorTest.java
+++ b/modules/formats/json/src/test/java/org/apache/tamaya/json/JSONVisitorTest.java
@@ -51,7 +51,7 @@ public class JSONVisitorTest {
 		assertThat(data).isNotNull();
 
 		ObjectValue ov = data.toObjectValue();
-		assertThat(ov.getFields().size() == 6);
+		assertThat(ov.getValues().size() == 6);
 		assertEquals(data.getSize(), 6);
 		assertThat(data.toMap()).containsKeys("key.sub", "anotherKey", "notAnotherKey", "number", "null");
 		assertThat(data.toMap()).containsEntry("key.sub", "createValue");
diff --git a/modules/formats/yaml/src/main/java/org/apache/tamaya/yaml/YAMLFormat.java b/modules/formats/yaml/src/main/java/org/apache/tamaya/yaml/YAMLFormat.java
index 4c50573..fae48ce 100644
--- a/modules/formats/yaml/src/main/java/org/apache/tamaya/yaml/YAMLFormat.java
+++ b/modules/formats/yaml/src/main/java/org/apache/tamaya/yaml/YAMLFormat.java
@@ -92,16 +92,16 @@ public class YAMLFormat implements ConfigurationFormat {
     private void addObject(Map<String,Object> values, ObjectValue dataNode){
         values.entrySet().forEach(en -> {
             if (en.getValue() instanceof List) {
-                ListValue list = dataNode.setFieldList(en.getKey());
+                ListValue list = dataNode.setList(en.getKey());
                 addList((List) en.getValue(), list);
             } else if (en.getValue() instanceof Map) {
-                ObjectValue object = dataNode.setFieldObject(en.getKey());
+                ObjectValue object = dataNode.setObject(en.getKey());
                 addObject((Map) en.getValue(), object);
             } else{
                 if (en.getValue() == null) {
-                    dataNode.setField(en.getKey(), null);
+                    dataNode.setValue(en.getKey(), null);
                 }else {
-                    dataNode.setField(en.getKey(), String.valueOf(en.getValue()));
+                    dataNode.setValue(en.getKey(), String.valueOf(en.getValue()));
                 }
             }
         });