Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement #246, works awesome in tests, not so much in an OSGi contai…
…ner for some reason
- Loading branch information
Showing
17 changed files
with
317 additions
and
16 deletions.
There are no files selected for viewing
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
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
19 changes: 19 additions & 0 deletions
19
hawtio-json-schema-mbean/src/main/java/io/hawt/jsonschema/api/MixInAnnotation.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.hawt.jsonschema.api; | ||
|
||
/** | ||
* @author Stan Lewis | ||
*/ | ||
public interface MixInAnnotation { | ||
|
||
/** | ||
* Return the class or interface whose annotations will be added to the target's annotations, overriding as needed | ||
*/ | ||
Class getMixinSource(); | ||
|
||
/** | ||
* Return the target class or interface whose annotations should be overridden | ||
*/ | ||
|
||
Class getTarget(); | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...BeanValidationAnnotationIntrospector.java → ...BeanValidationAnnotationIntrospector.java
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...jsonschema/ObjectWithJaxbAnnotations.java → ...st/objects/ObjectWithJaxbAnnotations.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.hawt.jsonschema; | ||
package io.hawt.jsonschema.test.objects; | ||
|
||
/** | ||
* @author Stan Lewis | ||
|
2 changes: 1 addition & 1 deletion
2
...jsonschema/ObjectWithJsonAnnotations.java → ...st/objects/ObjectWithJsonAnnotations.java
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
13 changes: 13 additions & 0 deletions
13
...n-schema-mbean/src/test/java/io/hawt/jsonschema/test/objects/ObjectWithMixinOverride.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.hawt.jsonschema.test.objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* @author Stan Lewis | ||
*/ | ||
public class ObjectWithMixinOverride { | ||
|
||
@JsonProperty(value="cheese") | ||
public String string1; | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...hema/ObjectWithValidationAnnotations.java → ...ects/ObjectWithValidationAnnotations.java
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>project</artifactId> | ||
<groupId>io.hawt</groupId> | ||
<version>1.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>hawtio-json-schema-mixins</artifactId> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>io.hawt</groupId> | ||
<artifactId>hawtio-json-schema-mbean</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.fusesource.fabric</groupId> | ||
<artifactId>fabric-core</artifactId> | ||
<version>${fabric-version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>${junit-version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
|
||
|
||
</project> |
53 changes: 53 additions & 0 deletions
53
...ma-mixins/src/main/java/io/hawt/jsonschema/mixins/CreateContainerBasicMixinOverrides.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.hawt.jsonschema.mixins; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import io.hawt.jsonschema.api.MixInAnnotation; | ||
import org.fusesource.fabric.api.CreateContainerBasicOptions; | ||
import org.fusesource.fabric.api.CreateContainerMetadata; | ||
import org.fusesource.fabric.api.CreationStateListener; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author Stan Lewis | ||
*/ | ||
public class CreateContainerBasicMixinOverrides implements MixInAnnotation { | ||
|
||
@Override | ||
public Class getMixinSource() { | ||
return CreateContainerMixin.class; | ||
} | ||
|
||
@Override | ||
public Class getTarget() { | ||
return CreateContainerBasicOptions.class; | ||
} | ||
} | ||
|
||
|
||
abstract class CreateContainerMixin extends CreateContainerBasicOptions { | ||
|
||
@JsonIgnore | ||
protected String zookeeperUrl; | ||
|
||
@JsonIgnore | ||
protected String zookeeperPassword; | ||
|
||
@JsonIgnore | ||
protected Map<String, CreateContainerMetadata<?>> metadataMap; | ||
|
||
@JsonIgnore | ||
private CreationStateListener creationStateListener; | ||
|
||
@Override | ||
@JsonIgnore | ||
public CreationStateListener getCreationStateListener() { | ||
return null; | ||
} | ||
|
||
@Override | ||
@JsonIgnore | ||
public void setCreationStateListener(CreationStateListener creationStateListener) { | ||
|
||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...a-mixins/src/main/java/io/hawt/jsonschema/mixins/CreateContainerRemoteMixinOverrides.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.hawt.jsonschema.mixins; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import io.hawt.jsonschema.api.MixInAnnotation; | ||
import org.fusesource.fabric.api.CreateEnsembleOptions; | ||
import org.fusesource.fabric.api.CreateRemoteContainerOptions; | ||
|
||
/** | ||
* @author Stan Lewis | ||
*/ | ||
public class CreateContainerRemoteMixinOverrides implements MixInAnnotation { | ||
|
||
@Override | ||
public Class getMixinSource() { | ||
return CreateRemoteContainerMixin.class; | ||
} | ||
|
||
@Override | ||
public Class getTarget() { | ||
return CreateRemoteContainerOptions.class; | ||
} | ||
} | ||
|
||
|
||
interface CreateRemoteContainerMixin extends CreateRemoteContainerOptions { | ||
|
||
@JsonIgnore | ||
CreateEnsembleOptions getCreateEnsembleOptions(); | ||
|
||
@JsonIgnore | ||
void setCreateEnsembleOptions(CreateEnsembleOptions createEnsembleOptions); | ||
|
||
|
||
} |
Oops, something went wrong.