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

com.fastchar.extjs.accepter.FastExtEnumAccepter Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
package com.fastchar.extjs.accepter;

import com.fastchar.core.FastEngine;
import com.fastchar.interfaces.IFastScannerAccepter;
import com.fastchar.utils.FastClassUtils;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("unchecked")
public class FastExtEnumAccepter implements IFastScannerAccepter {

    public static Map> ENUM_MAP = new HashMap<>();

    @Override
    public boolean onScannerClass(FastEngine engine, Class scannedClass) throws Exception {
        if (scannedClass.isEnum()) {
            if (!FastClassUtils.checkNewInstance(scannedClass)) {
                return false;
            }
            ENUM_MAP.put(scannedClass.getSimpleName(), (Class) scannedClass);
            return true;
        }
        return false;
    }

    @Override
    public boolean onScannerFile(FastEngine engine, File file) throws Exception {
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy