本文整理了Java中java.lang.Package.getAnnotationsByType()
方法的一些代码示例,展示了Package.getAnnotationsByType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Package.getAnnotationsByType()
方法的具体详情如下:
包路径:java.lang.Package
类名称:Package
方法名:getAnnotationsByType
暂无
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> clazzEntity, Map<String, FieldSearch> mapFieldSearch) {
JArchSearchWhereJpa[] archSearchWhereJpas = clazzEntity.getPackage().getAnnotationsByType(JArchSearchWhereJpa.class);
for (int i = 0; i < archSearchWhereJpas.length; i++) {
JArchSearchWhereJpa anotacao = archSearchWhereJpas[i];
createSearchField(clazzEntity, mapFieldSearch, anotacao);
}
}
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> classActionEntity, Map<String, FieldSearch> mapFieldSearch) {
Class<?> classEntity;
if (IBaseListAction.class.isAssignableFrom(classActionEntity)) {
classEntity = ReflectionUtils.getGenericClass(classActionEntity, 0);
} else {
classEntity = classActionEntity;
}
createFromSearchTab(null, classActionEntity.getPackage().getAnnotationsByType(JArchSearchFieldLookup.class), classEntity, mapFieldSearch);
for (JArchSearchTab searchTab : classActionEntity.getPackage().getAnnotationsByType(JArchSearchTab.class)) {
createFromSearchTab(searchTab, searchTab.searchFieldLookups(), classEntity, mapFieldSearch);
}
}
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> classActionEntity, Map<String, FieldSearch> mapFieldSearch) {
Class<?> classEntity;
if (IBaseListAction.class.isAssignableFrom(classActionEntity)) {
classEntity = ReflectionUtils.getGenericClass(classActionEntity, 0);
} else {
classEntity = classActionEntity;
}
createFromArray(null, classEntity, classActionEntity.getPackage().getAnnotationsByType(JArchSearchFieldCombobox.class), mapFieldSearch);
JArchSearchTab[] searchTabs = classEntity.getPackage().getAnnotationsByType(JArchSearchTab.class);
for (JArchSearchTab searchTab : searchTabs) {
createFromArray(searchTab, classEntity, searchTab.searchFieldComboboxes(), mapFieldSearch);
}
}
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> classActionEntity, Map<String, FieldSearch> mapFieldSearch) {
Class<?> classEntity;
if (IBaseListAction.class.isAssignableFrom(classActionEntity)) {
classEntity = ReflectionUtils.getGenericClass(classActionEntity, 0);
} else {
classEntity = classActionEntity;
}
createFromPackage(null, classActionEntity.getPackage().getAnnotationsByType(JArchSearchFieldCheckbox.class), classEntity, mapFieldSearch);
for (JArchSearchTab searchTab : classActionEntity.getPackage().getAnnotationsByType(JArchSearchTab.class)) {
createFromPackage(searchTab, searchTab.searchFieldCheckboxes(), classEntity, mapFieldSearch);
}
}
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> classActionEntity, Map<String, FieldSearch> mapFieldSearch) {
Class<?> classEntity;
if (IBaseListAction.class.isAssignableFrom(classActionEntity)) {
classEntity = ReflectionUtils.getGenericClass(classActionEntity, 0);
} else {
classEntity = classActionEntity;
}
createFromPackage(null, classActionEntity.getPackage().getAnnotationsByType(JArchSearchFieldComboboxCommandJpa.class), classEntity, mapFieldSearch);
for (JArchSearchTab searchTab : classActionEntity.getPackage().getAnnotationsByType(JArchSearchTab.class)) {
createFromPackage(searchTab, searchTab.searchFieldComboboxCommandJpas(), classEntity, mapFieldSearch);
}
}
代码示例来源:origin: br.com.jarch/jarch-crud
private void createFromPackage(Class<?> classActionEntity, Map<String, FieldSearch> mapFieldSearch) {
Class<?> classEntity;
if (IBaseListAction.class.isAssignableFrom(classActionEntity)) {
classEntity = ReflectionUtils.getGenericClass(classActionEntity, 0);
} else {
classEntity = classActionEntity;
}
createFromSearchTab(null, classActionEntity.getPackage().getAnnotationsByType(JArchSearchField.class), classEntity, mapFieldSearch);
for (JArchSearchTab searchTab : classActionEntity.getPackage().getAnnotationsByType(JArchSearchTab.class)) {
createFromSearchTab(searchTab, searchTab.searchFields(), classEntity, mapFieldSearch);
}
}
代码示例来源:origin: elki-project/elki
private static List<Map.Entry<Reference, TreeSet<Object>>> sortedReferences() {
Map<Reference, TreeSet<Object>> map = new HashMap<>();
HashSet<Package> packages = new HashSet<>();
for(Class<?> cls : ELKIServiceRegistry.findAllImplementations(Object.class, true, false)) {
inspectClass(cls, map);
if(packages.add(cls.getPackage())) {
Package p = cls.getPackage();
addReference(p, p.getAnnotationsByType(Reference.class), map);
}
}
// Sort references by first class.
List<Map.Entry<Reference, TreeSet<Object>>> refs = new ArrayList<>(map.entrySet());
Collections.sort(refs, SORT_BY_FIRST_CLASS);
return refs;
}
代码示例来源:origin: br.com.jarch/jarch-crud
private static ColumnsList createColumnsFromPackage(Package packageSource, Class<?> clazzEntity) {
ColumnsList listaColunaLista = new ColumnsList();
JArchColumnDataTable[] archColumnDataTables = packageSource.getAnnotationsByType(JArchColumnDataTable.class);
addColumnDataTable(clazzEntity, listaColunaLista, archColumnDataTables);
return listaColunaLista;
}
内容来源于网络,如有侵权,请联系作者删除!