当前位置: 首页>>代码示例>>Java>>正文


Java ASMDataTable.getAll方法代码示例

本文整理汇总了Java中cpw.mods.fml.common.discovery.ASMDataTable.getAll方法的典型用法代码示例。如果您正苦于以下问题:Java ASMDataTable.getAll方法的具体用法?Java ASMDataTable.getAll怎么用?Java ASMDataTable.getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.common.discovery.ASMDataTable的用法示例。


在下文中一共展示了ASMDataTable.getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAllClasses

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
public void processAllClasses(ASMDataTable dataTable, Map<Class<? extends Annotation>, Class<? extends ConfigEntry<? extends Annotation, ?>>> staticMap) {
    for (Map.Entry<Class<? extends Annotation>, Class<? extends ConfigEntry<? extends Annotation, ?>>> entry : staticMap.entrySet()) {
        try {
            annotationMap.put(entry.getKey(), entry.getValue().newInstance().setConfig(config));
        } catch (InstantiationException | IllegalAccessException e) {
            DPLogger.severe("Failed to create instance of the registered ConfigEntry!", e);
        }
    }

    ArrayList<String> processedClasses = new ArrayList<>();
    for (Class<? extends Annotation> clazz : annotationMap.keySet()) {
        for (ASMData asmData : dataTable.getAll(clazz.getName())) {
            String className = asmData.getClassName();
            if (childClasses.contains(className) && !processedClasses.contains(className)) {
                processedClasses.add(className);
                processClass(className);
            }
        }
    }
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:21,代码来源:ConfigContainer.java

示例2: processAllClasses

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
public void processAllClasses(ASMDataTable dataTable, Map<Class<? extends Annotation>, Class<? extends ConfigEntry<? extends Annotation, ?>>> staticMap) {
    for (Map.Entry<Class<? extends Annotation>, Class<? extends ConfigEntry<? extends Annotation, ?>>> entry : staticMap.entrySet()) {
        try {
            annotationMap.put(entry.getKey(), entry.getValue().newInstance().setConfig(config));
        } catch (InstantiationException | IllegalAccessException e) {
            CoreProperties.logger.fatal("Failed to create instance of the registered ConfigEntry!", e);
        }
    }

    ArrayList<String> processedClasses = new ArrayList<>();
    for (Class<? extends Annotation> clazz : annotationMap.keySet()) {
        for (ASMData asmData : dataTable.getAll(clazz.getName())) {
            String className = asmData.getClassName();
            if (childClasses.contains(className) && !processedClasses.contains(className)) {
                processedClasses.add(className);
                processClass(className);
            }
        }
    }
}
 
开发者ID:Jezza,项目名称:OmnisCore,代码行数:21,代码来源:ConfigContainer.java

示例3: initTable

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
public void initTable(ASMDataTable dataTable)
{
    optionals = ArrayListMultimap.create();
    Set<ASMData> interfaceLists = dataTable.getAll("cpw.mods.fml.common.Optional$InterfaceList");
    addData(unpackInterfaces(interfaceLists));
    Set<ASMData> interfaces = dataTable.getAll("cpw.mods.fml.common.Optional$Interface");
    addData(interfaces);
    Set<ASMData> methods = dataTable.getAll("cpw.mods.fml.common.Optional$Method");
    addData(methods);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:11,代码来源:ModAPITransformer.java

示例4: constructMod

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
@Subscribe
public void constructMod(FMLConstructionEvent event) {
    log.info("LambdaLib|Core is loading.");

    // Get annotation information from forge asm data table.
    // This must be done before PreInit stage.
    ASMDataTable data = event.getASMHarvestedData();

    Set<String> removedClasses = Sets.newHashSet();
    { // Get removed classes
        String startupSide = FMLCommonHandler.instance().getSide().toString();
        Set<ASMData> sideData = data.getAll("cpw.mods.fml.relauncher.SideOnly");
        for (ASMData ad : sideData) if (ad.getClassName().equals(ad.getObjectName())) { // If is a class
            EnumHolder enumHolder = (EnumHolder) ad.getAnnotationInfo().get("value");
            try {
                String value = (String) ehFieldValue.get(enumHolder);
                if (!value.equals(startupSide)) {
                    removedClasses.add(ad.getClassName());
                }
            } catch (IllegalAccessException ex) {
                throw Throwables.propagate(ex);
            }
        }
    }

    LLModContainer.removedClasses.addAll(removedClasses);

    Set<String> registrants = mapToClass(data.getAll("cn.lambdalib.annoreg.core.Registrant"));
    registrants.removeAll(removedClasses);
    RegistrationManager.INSTANCE.annotationList(registrants);

    Set<String> registryTypes = mapToClass(data.getAll("cn.lambdalib.annoreg.core.RegistryTypeDecl"));
    registryTypes.removeAll(removedClasses);
    RegistrationManager.INSTANCE.addRegistryTypes(registryTypes);

    Set<String> registryMods = mapToClass(data.getAll("cn.lambdalib.annoreg.core.RegistrationMod"));
    registryMods.removeAll(removedClasses);
    RegistrationManager.INSTANCE.addAnnotationMod(registryMods);
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:40,代码来源:LLModContainer.java

示例5: parseControllers

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
public void parseControllers(FMLPreInitializationEvent event) {
    if (init)
        return;
    init = true;

    ASMDataTable asmDataTable = event.getAsmData();
    Set<ASMData> asmDataSet = asmDataTable.getAll(Controller.class.getName());

    // Filters out all controller annotations and places them with their associated mod.
    for (ASMData data : asmDataSet) {
        ModCandidate candidate = data.getCandidate();
        for (ModContainer modContainer : candidate.getContainedMods()) {
            String modId = modContainer.getModId();
            if (!configMap.containsKey(modId))
                configMap.put(modId, new ConfigData(modContainer, candidate.getClassList()));
            configMap.get(modId).addRoot(data);
        }
    }

    // Process all potential registrars first.
    for (ConfigData configValue : configMap.values())
        if (configValue.isRegistrar)
            configValue.processIConfigRegistrar(this);
    processed = true;

    for (ConfigData configData : configMap.values()) {
        // Organise all sub-packages.
        configData.processRoots();

        // Process all current classes associated with the ConfigContainer.
        configData.processConfigContainers(asmDataTable, annotationMap);
    }
    postProcessed = true;
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:35,代码来源:ConfigHandler.java

示例6: loadFeatureGroupsFromAnnotations

import cpw.mods.fml.common.discovery.ASMDataTable; //导入方法依赖的package包/类
public void loadFeatureGroupsFromAnnotations(ASMDataTable asmData) {
	for (ASMData fgAnnotation : asmData.getAll(FeatureGroup.class.getName())) {
		@SuppressWarnings("unchecked")
		final List<String> featureGroups = (List<String>)fgAnnotation.getAnnotationInfo().get("value");
		for (String featureGroup : featureGroups)
			ensureExists(featureGroup);
	}
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral,代码行数:9,代码来源:FeatureGroupManager.java


注:本文中的cpw.mods.fml.common.discovery.ASMDataTable.getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。