當前位置: 首頁>>代碼示例>>Java>>正文


Java Resource類代碼示例

本文整理匯總了Java中javax.annotation.Resource的典型用法代碼示例。如果您正苦於以下問題:Java Resource類的具體用法?Java Resource怎麽用?Java Resource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Resource類屬於javax.annotation包,在下文中一共展示了Resource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import javax.annotation.Resource; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
    super.setUp();
    URL persistenceProviderUrl = FileUtil.getArchiveRoot(PersistenceProvider.class.getProtectionDomain().getCodeSource().getLocation());
    ProtectionDomain domain = Resource.class.getProtectionDomain();
    System.out.println("Protection domain: " + domain);
    CodeSource source = domain.getCodeSource();
    System.out.println("Code source: " + source);
    if (source != null) {
        URL location = source.getLocation();
        System.out.println("Location: " + location);
        URL resourceUrl = FileUtil.getArchiveRoot(location);
        addCompileRoots(Arrays.asList(persistenceProviderUrl, resourceUrl));
    } else {
        addCompileRoots(Arrays.asList(persistenceProviderUrl));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:PersistenceTestCase.java

示例2: resolve

import javax.annotation.Resource; //導入依賴的package包/類
@Override
public Object resolve(final InjectionPoint injectionPoint) {
    final Resource annotation = injectionPoint.getAnnotated().getAnnotation(Resource.class);
    if (null == annotation) {
        return null;
    }
    if (Topic.class != injectionPoint.getType()) {
        return null;
    }
    return new TestEEfiTopic(annotation.mappedName());
}
 
開發者ID:dajudge,項目名稱:testee.fi,代碼行數:12,代碼來源:TopicResourceProvider.java

示例3: resolve

import javax.annotation.Resource; //導入依賴的package包/類
@Override
public Object resolve(final InjectionPoint injectionPoint) {
    if (injectionPoint.getAnnotated().getAnnotation(Resource.class) == null) {
        return null;
    }
    return resources.get(injectionPoint.getAnnotated().getAnnotation(Resource.class).mappedName());
}
 
開發者ID:dajudge,項目名稱:testee.fi,代碼行數:8,代碼來源:ManualResourceProviderBuilder.java

示例4: loadFieldsAnnotation

import javax.annotation.Resource; //導入依賴的package包/類
protected static void loadFieldsAnnotation(Context context, Class<?> classClass) {
	// Initialize the annotations
	Field[] fields = Introspection.getDeclaredFields(classClass);
	if (fields != null && fields.length > 0) {
		for (Field field : fields) {
			Resource annotation = field.getAnnotation(Resource.class);
			if (annotation != null) {
				String defaultName = classClass.getName() + SEPARATOR + field.getName();
				Class<?> defaultType = field.getType();
				addResource(context, annotation, defaultName, defaultType);
			}
		}
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:15,代碼來源:WebAnnotationSet.java

示例5: addItemMenu

import javax.annotation.Resource; //導入依賴的package包/類
/**Ajout d'un menu d'item avec ou sans sous menu
 * @param caption le libelle
 * @param viewName la vue rattachee
 * @param icon l'icon du menu
 * @param itemMenu l'item menu rattache
 * @param mapSubMenu un eventuel sous-menu
 */
private void addItemMenu(String caption, String viewName, com.vaadin.server.Resource icon, LinkedList<SubMenu> subMenus, AccordionItemMenu itemMenu) {
	OneClickButton itemBtn = new OneClickButton(caption, icon);
	Menu menu = new Menu(viewName,subMenus,itemBtn);
	itemBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM);
	/*Pas de sous menu*/
	if (subMenus==null){
		itemBtn.addClickListener(e -> {
			navigateToView(viewName);
		});
		viewButtons.put(viewName, menu);
		if (itemMenu!=null){
			viewAccordion.put(viewName, (String)itemMenu.getData());
		}
	}
	/*Des sous menu, on associe le bouton du menu à chaque vue de sous menu*/
	else{
		subMenus.forEach(e -> {
			viewButtons.put(e.getVue(), menu);
			if (itemMenu!=null){
				viewAccordion.put(e.getVue(), (String)itemMenu.getData());
			}
		});
		itemBtn.addClickListener(e -> {
			navigateToView(subMenus.getFirst().getVue());
		});
		
	}
	if (itemMenu==null){
		menuButtonLayout.addComponent(itemBtn);
	}else{
		itemMenu.addButton(itemBtn);			
	}
	
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:42,代碼來源:MainUI.java

示例6: injectResource

import javax.annotation.Resource; //導入依賴的package包/類
private void injectResource(final Object provider) throws IllegalAccessException {
    final Field[] resourceFieldArray = FieldUtils.getFieldsWithAnnotation(provider.getClass(), Resource.class);
    if (ArrayUtils.isEmpty(resourceFieldArray)) {
        return;
    }
    for (final Field resourceField : resourceFieldArray) {
        final Class<?> fieldType = resourceField.getType();
        // ConfigInfo注入
        if (ConfigInfo.class.isAssignableFrom(fieldType)) {
            final ConfigInfo configInfo = new DefaultConfigInfo(cfg);
            FieldUtils.writeField(resourceField, provider, configInfo, true);
        }
    }
}
 
開發者ID:alibaba,項目名稱:jvm-sandbox,代碼行數:15,代碼來源:DefaultProviderManager.java

示例7: setAccountLockService

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setAccountLockService(AccountLockService accountLockService) {
    this.accountLockService = accountLockService;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:AccountLogService.java

示例8: setAccountInfoManager

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setAccountInfoManager(AccountInfoManager accountInfoManager) {
    this.accountInfoManager = accountInfoManager;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:AccountInfoController.java

示例9: setAccessManager

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setAccessManager(AccessManager accessManager) {
    this.accessManager = accessManager;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:AuthService.java

示例10: setJdbcTemplate

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
    this.jdbcTemplate = jdbcTemplate;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:IndexController.java

示例11: setBpmConfNodeManager

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setBpmConfNodeManager(BpmConfNodeManager bpmConfNodeManager) {
    this.bpmConfNodeManager = bpmConfNodeManager;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:BpmConfCountersignController.java

示例12: setExportor

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setExportor(Exportor exportor) {
    this.exportor = exportor;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:TaskInfoController.java

示例13: setAccountLogService

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setAccountLogService(AccountLogService accountLogService) {
    this.accountLogService = accountLogService;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:AccountLogConsumer.java

示例14: setTaskDefinitionConnector

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setTaskDefinitionConnector(
        TaskDefinitionConnector taskDefinitionConnector) {
    this.taskDefinitionConnector = taskDefinitionConnector;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:6,代碼來源:BpmConfAssignController.java

示例15: setPartyEntityManager

import javax.annotation.Resource; //導入依賴的package包/類
@Resource
public void setPartyEntityManager(PartyEntityManager partyEntityManager) {
    this.partyEntityManager = partyEntityManager;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:5,代碼來源:PartyStructController.java


注:本文中的javax.annotation.Resource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。