Added wrapper class for config to remove dependency on runtime settings
parent
20422642d0
commit
bbcecbc85f
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2012 YAMJ Members
|
||||||
|
* http://code.google.com/p/moviejukebox/people/list
|
||||||
|
*
|
||||||
|
* Web: http://code.google.com/p/moviejukebox/
|
||||||
|
*
|
||||||
|
* This software is licensed under a Creative Commons License
|
||||||
|
* See this page: http://code.google.com/p/moviejukebox/wiki/License
|
||||||
|
*
|
||||||
|
* For any reuse or distribution, you must make clear to others the
|
||||||
|
* license terms of this work.
|
||||||
|
*/
|
||||||
|
package com.moviejukebox.themoviedb.wrapper;
|
||||||
|
|
||||||
|
import com.moviejukebox.themoviedb.model.TmdbConfiguration;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.codehaus.jackson.annotate.JsonAnySetter;
|
||||||
|
import org.codehaus.jackson.annotate.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Stuart
|
||||||
|
*/
|
||||||
|
public class WrapperConfig {
|
||||||
|
/*
|
||||||
|
* Logger
|
||||||
|
*/
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(WrapperConfig.class);
|
||||||
|
/*
|
||||||
|
* Properties
|
||||||
|
*/
|
||||||
|
@JsonProperty("images")
|
||||||
|
private TmdbConfiguration tmdbConfiguration;
|
||||||
|
|
||||||
|
public TmdbConfiguration getTmdbConfiguration() {
|
||||||
|
return tmdbConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTmdbConfiguration(TmdbConfiguration tmdbConfiguration) {
|
||||||
|
this.tmdbConfiguration = tmdbConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle unknown properties and print a message
|
||||||
|
* @param key
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
@JsonAnySetter
|
||||||
|
public void handleUnknown(String key, Object value) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Unknown property: '").append(key);
|
||||||
|
sb.append("' value: '").append(value).append("'");
|
||||||
|
LOGGER.warn(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue