Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Commit

Permalink
Make ResourceProperty inherit the abstract BeanProperty.Std instead o…
Browse files Browse the repository at this point in the history
…f implementing the interface, to avoid incompatibility with jackson 2.6.0
  • Loading branch information
ghillairet committed Sep 10, 2015
1 parent b027276 commit e7d28b2
Showing 1 changed file with 10 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@
*/
package org.emfjson.jackson.databind.deser;

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.PropertyMetadata;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.introspect.AnnotationMap;
import com.fasterxml.jackson.databind.type.SimpleType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.emfjson.common.ReferenceEntries;

import java.lang.annotation.Annotation;

public class ResourceProperty implements BeanProperty {
public class ResourceProperty extends BeanProperty.Std {

private final ResourceSet resourceSet;
private final Resource resource;
private final ReferenceEntries entries;

private static final JavaType type = SimpleType.construct(EObject.class);
private static final PropertyName propertyName = PropertyName.construct("contents", "org.emfjson.resource");

public ResourceProperty(ResourceSet resourceSet, Resource resource, ReferenceEntries entries) {
super(propertyName, type, propertyName, new AnnotationMap(), null, PropertyMetadata.STD_REQUIRED);
this.resourceSet = resourceSet;
this.resource = resource;
this.entries = entries;
Expand All @@ -46,52 +50,4 @@ public ReferenceEntries getEntries() {
return entries;
}

@Override
public String getName() {
return "contents";
}

@Override
public PropertyName getFullName() {
return PropertyName.construct("contents", "org.emfjson.resource");
}

@Override
public JavaType getType() {
return SimpleType.construct(EObject.class);
}

@Override
public PropertyName getWrapperName() {
return null;
}

@Override
public PropertyMetadata getMetadata() {
return null;
}

@Override
public boolean isRequired() {
return false;
}

@Override
public <A extends Annotation> A getAnnotation(Class<A> acls) {
return null;
}

@Override
public <A extends Annotation> A getContextAnnotation(Class<A> acls) {
return null;
}

@Override
public AnnotatedMember getMember() {
return null;
}

@Override
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor) throws JsonMappingException {}

}

0 comments on commit e7d28b2

Please sign in to comment.