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 2017/12/10 22:03:42 UTC
[19/23] incubator-tamaya git commit: Reimplemented (also simjplified)
Tamaya core completely based on latest JSR API. Moved prior Tamaya API into
compat module.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
deleted file mode 100644
index f258186..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.Duration;
-import java.time.temporal.ChronoUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class DurationConverter implements PropertyConverter<Duration> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public Duration convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(),
- Duration.of(1234, ChronoUnit.SECONDS).toString());
- try {
- return Duration.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse Duration: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
deleted file mode 100644
index e9891be..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FileConverter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.io.File;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to URI, using new URL(value).
- */
-@Component(service = PropertyConverter.class)
-public class FileConverter implements PropertyConverter<File> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public File convert(String value, ConversionContext context) {
- if(value==null || value.isEmpty()){
- return null;
- }
- context.addSupportedFormats(getClass(),"<File>");
- String trimmed = Objects.requireNonNull(value).trim();
- try {
- return new File(trimmed);
- } catch (Exception e) {
- LOG.log(Level.FINE, "Unparseable File Name: " + trimmed, e);
- }
- return null;
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
deleted file mode 100644
index 84daa10..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.util.Locale;
-import java.util.Objects;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Float, using the Java number syntax:
- * (-)?[0-9]*\.[0-9]*. In case of error the value given also is tried being parsed as integral number using
- * {@link LongConverter}. Additionally the following values are supported:
- * <ul>
- * <li>NaN (ignoring case)</li>
- * <li>POSITIVE_INFINITY (ignoring case)</li>
- * <li>NEGATIVE_INFINITY (ignoring case)</li>
- * </ul>
- */
-@Component(service = PropertyConverter.class)
-public class FloatConverter implements PropertyConverter<Float> {
- /**
- * The logger.
- */
- private static final Logger LOG = Logger.getLogger(FloatConverter.class.getName());
- /**
- * The converter used, when floating point parse failed.
- */
- private final IntegerConverter integerConverter = new IntegerConverter();
-
- @Override
- public Float convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), "<float>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE", "POSITIVE_INFINITY", "NEGATIVE_INFINITY", "NAN");
- String trimmed = Objects.requireNonNull(value).trim();
- switch(trimmed.toUpperCase(Locale.ENGLISH)){
- case "POSITIVE_INFINITY":
- return Float.POSITIVE_INFINITY;
- case "NEGATIVE_INFINITY":
- return Float.NEGATIVE_INFINITY;
- case "NAN":
- return Float.NaN;
- case "MIN_VALUE":
- case "MIN":
- return Float.MIN_VALUE;
- case "MAX_VALUE":
- case "MAX":
- return Float.MAX_VALUE;
- default:
- try {
- return Float.valueOf(trimmed);
- } catch(Exception e){
- // OK perhaps we have an integral number that must be converted to the double type...
- LOG.finest("Parsing of float as floating number failed, trying parsing integral" +
- " number/hex instead...");
- }
- Integer val = integerConverter.convert(trimmed, context);
- if(val!=null) {
- return val.floatValue();
- }
- LOG.finest("Unparseable float value: " + trimmed);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
deleted file mode 100644
index 4198b72..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/InstantConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.Instant;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class InstantConverter implements PropertyConverter<Instant> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public Instant convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), Instant.now().toString());
- try{
- return Instant.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse Instant: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
deleted file mode 100644
index d09df9b..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/IntegerConverter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.util.Locale;
-import java.util.Objects;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Integer, the supported format is one of the following:
- * <ul>
- * <li>123 (byte value)</li>
- * <li>0xFF (byte value)</li>
- * <li>0XDF (byte value)</li>
- * <li>0D1 (byte value)</li>
- * <li>-123 (byte value)</li>
- * <li>-0xFF (byte value)</li>
- * <li>-0XDF (byte value)</li>
- * <li>-0D1 (byte value)</li>
- * <li>MIN_VALUE (ignoring case)</li>
- * <li>MIN (ignoring case)</li>
- * <li>MAX_VALUE (ignoring case)</li>
- * <li>MAX (ignoring case)</li>
- * </ul>
- */
-@Component(service = PropertyConverter.class)
-public class IntegerConverter implements PropertyConverter<Integer>{
-
- /**
- * The logger.
- */
- private static final Logger LOG = Logger.getLogger(IntegerConverter.class.getName());
-
- @Override
- public Integer convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), "<int>", "MIN_VALUE", "MIN", "MAX_VALUE", "MAX");
- String trimmed = Objects.requireNonNull(value).trim();
- switch(trimmed.toUpperCase(Locale.ENGLISH)){
- case "MIN_VALUE":
- case "MIN":
- return Integer.MIN_VALUE;
- case "MAX_VALUE":
- case "MAX":
- return Integer.MAX_VALUE;
- default:
- try{
- return Integer.decode(trimmed);
- }
- catch(Exception e){
- LOG.finest("Unparseable Integer value: " + trimmed);
- return null;
- }
- }
-
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
deleted file mode 100644
index 3bf9b67..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.LocalDate;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class LocalDateConverter implements PropertyConverter<LocalDate> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public LocalDate convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), LocalDate.now().toString());
- try{
- return LocalDate.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse LocalDate: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
deleted file mode 100644
index eb14000..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.LocalDateTime;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class LocalDateTimeConverter implements PropertyConverter<LocalDateTime> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public LocalDateTime convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), LocalDateTime.now().toString());
- try{
- return LocalDateTime.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse LocalDateTime: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
deleted file mode 100644
index bf7d8ab..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.LocalTime;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class LocalTimeConverter implements PropertyConverter<LocalTime> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public LocalTime convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), LocalTime.now().toString());
- try{
- return LocalTime.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse LocalTime: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
deleted file mode 100644
index 121c490..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LongConverter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.util.Locale;
-import java.util.Objects;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Long, the supported format is one of the following:
- * <ul>
- * <li>123 (byte value)</li>
- * <li>0xFF (byte value)</li>
- * <li>0XDF (byte value)</li>
- * <li>0D1 (byte value)</li>
- * <li>-123 (byte value)</li>
- * <li>-0xFF (byte value)</li>
- * <li>-0XDF (byte value)</li>
- * <li>-0D1 (byte value)</li>
- * <li>MIN_VALUE (ignoring case)</li>
- * <li>MIN (ignoring case)</li>
- * <li>MAX_VALUE (ignoring case)</li>
- * <li>MAX (ignoring case)</li>
- * </ul>
- */
-@Component(service = PropertyConverter.class)
-public class LongConverter implements PropertyConverter<Long>{
-
- private static final Logger LOGGER = Logger.getLogger(LongConverter.class.getName());
-
- @Override
- public Long convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), "<long>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE");
-
- String trimmed = Objects.requireNonNull(value).trim();
- switch (trimmed.toUpperCase(Locale.ENGLISH)) {
- case "MIN_VALUE":
- case "MIN":
- return Long.MIN_VALUE;
- case "MAX_VALUE":
- case "MAX":
- return Long.MAX_VALUE;
- default:
- try {
- return Long.decode(trimmed);
- }
- catch(Exception e){
- LOGGER.finest("Unable to parse Long value: " + value);
- return null;
- }
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
deleted file mode 100644
index a7b2c43..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/NumberConverter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.math.BigDecimal;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Number. Valid inputs are:
- * <pre>
- * POSITIVE_INFINITY -> Double.POSITIVE_INFINITY
- * NEGATIVE_INFINITY -> Double.NEGATIVE_INFINITY
- * NaN > Double.NaN
- * 0xFFDCD3D2 -> Long
- * 1234566789.23642327352735273752 -> new BigDecimal(input)
- * </pre>
- */
-@Component(service = PropertyConverter.class)
-public class NumberConverter implements PropertyConverter<Number>{
- /** the logger. */
- private static final Logger LOGGER = Logger.getLogger(NumberConverter.class.getName());
- /** Converter used for trying to parse as an integral value. */
- private final LongConverter longConverter = new LongConverter();
-
- @Override
- public Number convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), "<double>, <long>", "0x (hex)", "0X... (hex)", "POSITIVE_INFINITY",
- "NEGATIVE_INFINITY", "NAN");
-
- String trimmed = Objects.requireNonNull(value).trim();
- switch(trimmed.toUpperCase(Locale.ENGLISH)) {
- case "POSITIVE_INFINITY":
- return Double.POSITIVE_INFINITY;
- case "NEGATIVE_INFINITY":
- return Double.NEGATIVE_INFINITY;
- case "NAN":
- return Double.NaN;
- default:
- Long lVal = longConverter.convert(trimmed, context);
- if (lVal != null) {
- return lVal;
- }
- try{
- return new BigDecimal(trimmed);
- }
- catch(Exception e){
- LOGGER.finest("Unparseable Number: " + trimmed);
- return null;
- }
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
deleted file mode 100644
index 062d584..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.OffsetDateTime;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class OffsetDateTimeConverter implements PropertyConverter<OffsetDateTime> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public OffsetDateTime convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), OffsetDateTime.now().toString());
- try{
- return OffsetDateTime.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse OffsetDateTime: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
deleted file mode 100644
index 794ad8a..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.time.OffsetTime;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class OffsetTimeConverter implements PropertyConverter<OffsetTime> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public OffsetTime convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), OffsetTime.now().toString());
- try{
- return OffsetTime.parse(value);
- }catch(Exception e){
- LOG.log(Level.FINEST, e, () -> "Cannot parse OffsetTime: " + value);
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OptionalConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OptionalConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OptionalConverter.java
deleted file mode 100644
index dc53c84..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OptionalConverter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.TypeLiteral;
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Optional;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class OptionalConverter implements PropertyConverter<Optional> {
-
- @Override
- public Optional convert(String value, ConversionContext context) {
- if(value==null){
- return Optional.empty();
- }
- try{
- Type targetType = context.getTargetType().getType();
- ParameterizedType pt = (ParameterizedType) targetType;
- if(String.class.equals(pt.getActualTypeArguments()[0])){
- return Optional.of(value);
- }
- ConvertQuery converter = new ConvertQuery(value, TypeLiteral.of(pt.getActualTypeArguments()[0]));
- return Optional.ofNullable(context.getConfiguration().query(converter));
- }catch(Exception e){
- throw new ConfigException("Error evaluating config value.", e);
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
deleted file mode 100644
index 404daee..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/PathConverter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.nio.file.FileSystems;
-import java.nio.file.Path;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to URI, using new URL(value).
- */
-@Component(service = PropertyConverter.class)
-public class PathConverter implements PropertyConverter<Path> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public Path convert(String value, ConversionContext context) {
- if(value==null || value.isEmpty()){
- return null;
- }
- context.addSupportedFormats(getClass(),"<File>");
- String trimmed = Objects.requireNonNull(value).trim();
- try {
- return FileSystems.getDefault().getPath(value);
- } catch (Exception e) {
- LOG.log(Level.FINE, "Unparseable Path: " + trimmed, e);
- }
- return null;
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ShortConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ShortConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ShortConverter.java
deleted file mode 100644
index 7b561f3..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/ShortConverter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.util.Locale;
-import java.util.Objects;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Short, the supported format is one of the following:
- * <ul>
- * <li>123 (byte value)</li>
- * <li>0xFF (byte value)</li>
- * <li>0XDF (byte value)</li>
- * <li>0D1 (byte value)</li>
- * <li>-123 (byte value)</li>
- * <li>-0xFF (byte value)</li>
- * <li>-0XDF (byte value)</li>
- * <li>-0D1 (byte value)</li>
- * <li>MIN_VALUE (ignoring case)</li>
- * <li>MIN (ignoring case)</li>
- * <li>MAX_VALUE (ignoring case)</li>
- * <li>MAX (ignoring case)</li>
- * </ul>
- */
-@Component(service = PropertyConverter.class)
-public class ShortConverter implements PropertyConverter<Short>{
-
- /** the logger. */
- private static final Logger LOG = Logger.getLogger(ShortConverter.class.getName());
-
- @Override
- public Short convert(String value, ConversionContext context) {
- context.addSupportedFormats(getClass(), "short", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE");
- String trimmed = Objects.requireNonNull(value).trim();
- switch(trimmed.toUpperCase(Locale.ENGLISH)){
- case "MIN_VALUE":
- case "MIN":
- return Short.MIN_VALUE;
- case "MAX_VALUE":
- case "MAX":
- return Short.MAX_VALUE;
- default:
- try{
- return Short.decode(trimmed);
- }
- catch(Exception e){
- LOG.finest("Unparseable Short: " + trimmed);
- return null;
- }
- }
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/SupplierConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/SupplierConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/SupplierConverter.java
deleted file mode 100644
index 05aa3d5..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/SupplierConverter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.TypeLiteral;
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.function.Supplier;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to Boolean.
- */
-@Component(service = PropertyConverter.class)
-public class SupplierConverter implements PropertyConverter<Supplier> {
-
- private static final Logger LOG = Logger.getLogger(SupplierConverter.class.getName());
-
- @Override
- public Supplier convert(String value, ConversionContext context) {
- return () -> {
- try{
- Type targetType = context.getTargetType().getType();
- ParameterizedType pt = (ParameterizedType) targetType;
- if(String.class.equals(pt.getActualTypeArguments()[0])){
- return value;
- }
- ConvertQuery converter = new ConvertQuery(value, TypeLiteral.of(pt.getActualTypeArguments()[0]));
- Object o = context.getConfiguration().query(converter);
- if(o==null){
- throw new ConfigException("No such value: " + context.getKey());
- }
- return o;
- }catch(Exception e){
- throw new ConfigException("Error evaluating config value.", e);
- }
- };
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
deleted file mode 100644
index 793631e..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URIConverter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.net.URI;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to URI, using new URI(value).
- */
-@Component(service = PropertyConverter.class)
-public class URIConverter implements PropertyConverter<URI> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public URI convert(String value, ConversionContext context) {
- if(value==null || value.isEmpty()){
- return null;
- }
- context.addSupportedFormats(getClass(), "<uri> -> new URI(uri)");
- String trimmed = Objects.requireNonNull(value).trim();
- try {
- return new URI(trimmed);
- } catch (Exception e) {
- LOG.log(Level.FINE, "Unparseable URI: " + trimmed, e);
- }
- return null;
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
deleted file mode 100644
index e1994bf..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.core.internal.converters;
-
-import org.apache.tamaya.spi.ConversionContext;
-import org.apache.tamaya.spi.PropertyConverter;
-import org.osgi.service.component.annotations.Component;
-
-import java.net.URL;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Converter, converting from String to URI, using new URL(value).
- */
-@Component(service = PropertyConverter.class)
-public class URLConverter implements PropertyConverter<URL> {
-
- private final Logger LOG = Logger.getLogger(getClass().getName());
-
- @Override
- public URL convert(String value, ConversionContext context) {
- if(value==null || value.isEmpty()){
- return null;
- }
- context.addSupportedFormats(getClass(),"<URL>");
- String trimmed = Objects.requireNonNull(value).trim();
- try {
- return new URL(trimmed);
- } catch (Exception e) {
- LOG.log(Level.FINE, "Unparseable URL: " + trimmed, e);
- }
- return null;
- }
-
- @Override
- public boolean equals(Object o){
- return getClass().equals(o.getClass());
- }
-
- @Override
- public int hashCode(){
- return getClass().hashCode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/converters/package-info.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/package-info.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/package-info.java
deleted file mode 100644
index 13f66c1..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Contains implementations of the converters provided by default.
- */
-package org.apache.tamaya.core.internal.converters;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/internal/package-info.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/package-info.java b/code/core/src/main/java/org/apache/tamaya/core/internal/package-info.java
deleted file mode 100644
index a99070b..0000000
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/package-info.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Contains implementations of different property sources for supporting
- * CLI, Environment and System Properties as well as simple properties
- * based on the formats defined by {@link java.util.Properties}.
- */
-package org.apache.tamaya.core.internal;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/java/org/apache/tamaya/core/package-info.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/package-info.java b/code/core/src/main/java/org/apache/tamaya/core/package-info.java
index eb7a398..ff43c59 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/package-info.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/package-info.java
@@ -20,5 +20,5 @@
/**
* This is the root package of the Apache Tamaya API implementation.
*/
-@org.osgi.annotation.versioning.Version("0.4")
+//@org.osgi.annotation.versioning.Version("0.4")
package org.apache.tamaya.core;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.Configuration
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.Configuration b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.Configuration
deleted file mode 100644
index e51a247..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.Configuration
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.core.internal.DefaultConfiguration
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.core.internal.ConfigValueEvaluator
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.core.internal.ConfigValueEvaluator b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.core.internal.ConfigValueEvaluator
deleted file mode 100644
index 624f0c1..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.core.internal.ConfigValueEvaluator
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.core.internal.DefaultConfigValueEvaluator
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationBuilder
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationBuilder b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationBuilder
deleted file mode 100644
index 700b2b5..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationBuilder
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.core.internal.CoreConfigurationContextBuilder
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
deleted file mode 100644
index c4aa43f..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.core.internal.CoreConfigurationProvider
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
deleted file mode 100644
index 396aef1..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.core.internal.converters.BooleanConverter
-org.apache.tamaya.core.internal.converters.ByteConverter
-org.apache.tamaya.core.internal.converters.CharConverter
-org.apache.tamaya.core.internal.converters.ClassConverter
-org.apache.tamaya.core.internal.converters.DoubleConverter
-org.apache.tamaya.core.internal.converters.FloatConverter
-org.apache.tamaya.core.internal.converters.IntegerConverter
-org.apache.tamaya.core.internal.converters.LongConverter
-org.apache.tamaya.core.internal.converters.ShortConverter
-org.apache.tamaya.core.internal.converters.BigDecimalConverter
-org.apache.tamaya.core.internal.converters.BigIntegerConverter
-org.apache.tamaya.core.internal.converters.CurrencyConverter
-org.apache.tamaya.core.internal.converters.NumberConverter
-org.apache.tamaya.core.internal.converters.URIConverter
-org.apache.tamaya.core.internal.converters.URLConverter
-org.apache.tamaya.core.internal.converters.FileConverter
-org.apache.tamaya.core.internal.converters.PathConverter
-org.apache.tamaya.core.internal.converters.DurationConverter
-org.apache.tamaya.core.internal.converters.LocalDateConverter
-org.apache.tamaya.core.internal.converters.LocalDateTimeConverter
-org.apache.tamaya.core.internal.converters.LocalTimeConverter
-org.apache.tamaya.core.internal.converters.OffsetDateTimeConverter
-org.apache.tamaya.core.internal.converters.OffsetTimeConverter
-org.apache.tamaya.core.internal.converters.InstantConverter
-org.apache.tamaya.core.internal.converters.OptionalConverter
-org.apache.tamaya.core.internal.converters.SupplierConverter
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
deleted file mode 100644
index d1e392d..0000000
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.spisupport.propertysource.EnvironmentPropertySource
-org.apache.tamaya.spisupport.propertysource.SystemPropertySource
-org.apache.tamaya.spisupport.propertysource.CLIPropertySource
-org.apache.tamaya.spisupport.propertysource.JavaConfigurationPropertySource
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/9bc56a38/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ServiceContext
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ServiceContext b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ServiceContext
index 135caa1..4364f06 100644
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ServiceContext
+++ b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.ServiceContext
@@ -16,4 +16,4 @@
# specific language governing permissions and limitations
# under the License.
#
-org.apache.tamaya.spisupport.DefaultServiceContext
+org.apache.tamaya.base.DefaultServiceContext