This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profile> | |
<id>dev</id> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<configuration> | |
<disableXmlReport>true</disableXmlReport> | |
<useFile>false</useFile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.examples.strategy; | |
public class DefaultStrategy implements Strategy { | |
DefaultStrategy() {} | |
public void execute() { | |
System.out.println("Default Strategy!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.examples.strategy; | |
public interface Strategy { | |
void execute(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.examples.strategy; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class StrategyFactory { | |
public static final String DEFAULT_STRATEGY_KEY = "default"; | |
public static final String SPECIFIC_STRATEGY_KEY = "specific"; | |
private static StrategyFactory instance = new StrategyFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.examples.strategy; | |
public class SpecificStrategy implements Strategy { | |
SpecificStrategy() {} | |
public void execute() { | |
System.out.println("Specific Strategy!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.restlet.jaxb; | |
import org.restlet.ext.jaxb.JaxbRepresentation; | |
import org.restlet.representation.Representation; | |
public class OSGiSafeJaxbRepresentation<T> extends JaxbRepresentation<T> { | |
public OSGiSafeJaxbRepresentation( | |
final Representation xmlRepresentation, final String contextPath) { | |
super(xmlRepresentation, contextPath, null, | |
OSGiSafeJaxbRepresentation.class.getClassLoader()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<provider> | |
<name>Provider Name</name> | |
<properties> | |
<property> | |
<name>address</name> | |
<value>194.132.9.45</value> | |
</property> | |
<property> | |
<name>username</name> | |
<value>testuser</username> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.example.jaxb; | |
import java.util.Map; | |
public class Provider { | |
private String name; | |
private Map<String, String> properties; | |
void setProperties(Map<String, String> properties) { | |
this.properties = properties; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.example.jaxb; | |
import javax.xml.bind.annotation.XmlElement; | |
class Property { | |
@XmlElement(name = "name") | |
private String name; | |
@XmlElement(name = "value") | |
private String value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tomasmalmsten.example.jaxb; | |
import javax.xml.bind.annotation.XmlElement; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
class Properties { | |
@XmlElement(name = "property") | |
private List<Property> entries = new ArrayList<>(); |
OlderNewer