Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added package infos #592

Merged
merged 1 commit into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion building-tools/src/main/resources/loose-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</module>

<module name="FileLength"/>
<!-- todo <module name="JavadocPackage"/> -->
<module name="JavadocPackage"/>

<module name="TreeWalker">

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Build mappings via Java Fluent API
*/
package com.github.dozermapper.core.builder.fluent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* {@link com.github.dozermapper.core.el.ELEngine} extension to JAXB model
*/
package com.github.dozermapper.core.builder.model.elengine;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Models that describes the mapping definitions
*/
package com.github.dozermapper.core.builder.model;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Build mappings via different API extensions
*/
package com.github.dozermapper.core.builder;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Build mappings via XML
*/
package com.github.dozermapper.core.builder.xml;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Caching for dozer objects
*/
package com.github.dozermapper.core.cache;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Defines the mapping style to use between the source and target objects.
*/
public enum MappingType {

/**
* Map from source field to target field
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Generators to resolve the different types and their fields
*/
package com.github.dozermapper.core.classmap.generator;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Mapping definition used internally for classes
*/
package com.github.dozermapper.core.classmap;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Configuration settings for
*/
package com.github.dozermapper.core.config;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import com.github.dozermapper.core.util.DozerClassLoader;
import com.github.dozermapper.core.util.MappingUtils;

/**
* Processes default resolvers, which are currently:
* {@link LegacyPropertiesSettingsResolver}, {@link SystemPropertySettingsResolver} and {@link SystemEnvironmentSettingsResolver}
*/
public class DefaultSettingsProcessor implements SettingsProcessor {

private final DozerClassLoader classLoader;
Expand All @@ -37,6 +41,9 @@ public DefaultSettingsProcessor(DozerClassLoader classLoader) {
this.classLoader = classLoader;
}

/**
* {@inheritDoc}
*/
@Override
public Settings process() {
createSettingsResolvers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@

import com.github.dozermapper.core.config.Settings;

/**
* Processes values retrieved by resolvers, to create {@link Settings}
*/
public interface SettingsProcessor {

/**
* Process resolvers to create {@link Settings}
*
* @return Configured {@link Settings}
*/
Settings process();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Processes values retrieved by resolvers
*/
package com.github.dozermapper.core.config.processors;
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public LegacyPropertiesSettingsResolver(DozerClassLoader classLoader, String con
this.configFile = configFile;
}

/**
* Loads dozer.properties from classpath
*/
@Override
public void init() {
properties = processFile();
Expand Down Expand Up @@ -73,6 +76,9 @@ private Properties processFile() {
return properties;
}

/**
* {@inheritDoc}
*/
@Override
public Object get(String key, Object defaultValue) {
return properties.getOrDefault(key, defaultValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@
*/
public interface SettingsResolver {

/**
* Initializes backing store and retrieves values into memory
*/
void init();

/**
* Gets value from in memory store
* @param key key to retrieve
* @param defaultValue value to default to if none found
* @return value found or default if none
*/
Object get(String key, Object defaultValue);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,20 @@
*/
public class SystemEnvironmentSettingsResolver implements SettingsResolver {

/**
* No-op
*/
@Override
public void init() {
//noop
}

/**
* Gets value from environment via {@link System#getenv}
* @param key key to retrieve
* @param defaultValue value to default to if none found
* @return value found or default if none
*/
@Override
public Object get(String key, Object defaultValue) {
Object value = System.getenv(getEnvironmentSafeKey(key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@
*/
public class SystemPropertySettingsResolver implements SettingsResolver {

/**
* No-op
*/
@Override
public void init() {
//noop
}

/**
* Gets value from system via {@link System#getProperty}
* @param key key to retrieve
* @param defaultValue value to default to if none found
* @return value found or default if none
*/
@Override
public Object get(String key, Object defaultValue) {
return System.getProperty(key, defaultValue == null ? null : String.valueOf(defaultValue));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public YAMLSettingsResolver(DozerClassLoader classLoader, String configFile) {
this.configFile = configFile;
}

/**
* Loads dozer.yaml from classpath
*/
@Override
public void init() {
Map<String, Map> settings = processFile();
Expand Down Expand Up @@ -117,6 +120,9 @@ private void processSettingsMap(Map<String, Map> settings) {
}
}

/**
* {@inheritDoc}
*/
@Override
public Object get(String key, Object defaultValue) {
return properties.getOrDefault(key, defaultValue);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Resolves values defined in a resource, such as .properties file
*/
package com.github.dozermapper.core.config.resolvers;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2005-2018 Dozer Project
*
* Licensed 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.
*/
/**
* Convertor extensions based on {@link org.apache.commons.beanutils.Converter}
*/
package com.github.dozermapper.core.converters;
Loading