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

org.sfm.reflect.meta.PropertyMeta Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 1.10.3
Show newest version
package org.sfm.reflect.meta;

import org.sfm.reflect.Getter;
import org.sfm.reflect.ReflectionService;
import org.sfm.reflect.Setter;

import java.lang.reflect.Type;


public abstract class PropertyMeta {
	private final String name;
	private final String column;
	
	protected final ReflectionService reflectService;
	
	private volatile Setter setter;
    private volatile Getter getter;
	private volatile ClassMeta

classMeta; public PropertyMeta(String name, String column, ReflectionService reflectService) { this.name = name; this.column = column; this.reflectService = reflectService; } public final Setter getSetter() { Setter lSetter = setter; if (lSetter == null) { lSetter = newSetter(); setter = lSetter; } return lSetter; } public final Getter getGetter() { Getter lGetter = getter; if (lGetter == null) { lGetter = newGetter(); getter = lGetter; } return lGetter; } protected abstract Setter newSetter(); protected abstract Getter newGetter(); public final String getName() { return name; } public final String getColumn() { return column; } public abstract Type getType(); public final ClassMeta

getClassMeta() { ClassMeta

meta = classMeta; if (meta == null) { meta = newClassMeta(); classMeta = meta; } return meta; } protected ClassMeta

newClassMeta() { return reflectService.getClassMeta(getType(), false); } public boolean isConstructorProperty() { return false; } public abstract String getPath(); public boolean isSubProperty() { return false; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy