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

org.sfm.reflect.meta.IndexedElement 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 java.util.ArrayList;
import java.util.List;

public class IndexedElement {

    private final PropertyMeta propertyMeta;
    private final ClassMeta elementClassMeta;
    private final PropertyFinder propertyFinder;
    private final List assignedPath = new ArrayList();

    public IndexedElement(PropertyMeta propertyMeta, ClassMeta elementClassMeta) {
        this.propertyMeta = propertyMeta;
        this.elementClassMeta = elementClassMeta;
        if (elementClassMeta != null) {
            propertyFinder = elementClassMeta.newPropertyFinder();
        } else {
            propertyFinder = null;
        }
    }

    public PropertyMeta getPropertyMeta() {
        return propertyMeta;
    }

    public ClassMeta getElementClassMeta() {
        return elementClassMeta;
    }

    public PropertyFinder getPropertyFinder() {
        return propertyFinder;
    }

    public void addProperty(PropertyMeta s) {
        addProperty(s.getPath());
    }

    public void addProperty(String path) {
        assignedPath.add(path);
    }

    public boolean hasProperty(PropertyMeta property) {
        return hasProperty(property.getPath());
    }

    public boolean hasProperty(String path) {
        return assignedPath.contains(path);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy