All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.katharsis.meta.internal.JsonObjectMetaProvider Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package io.katharsis.meta.internal;

import java.lang.reflect.Type;

import io.katharsis.core.internal.utils.ClassUtils;
import io.katharsis.meta.model.MetaDataObject;
import io.katharsis.meta.model.MetaElement;
import io.katharsis.meta.model.resource.MetaJsonObject;
import io.katharsis.resource.annotations.JsonApiResource;

public class JsonObjectMetaProvider extends MetaDataObjectProvider {

	@Override
	public boolean accept(Type type, Class metaClass) {
		boolean hasResourceAnnotation = ClassUtils.getRawType(type).getAnnotation(JsonApiResource.class) != null;
		return type instanceof Class && metaClass == MetaJsonObject.class && !hasResourceAnnotation;
	}

	@Override
	protected MetaDataObject newDataObject() {
		return new MetaJsonObject();
	}

	@Override
	protected Class getMetaClass() {
		return MetaJsonObject.class;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy