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


Java Externalizer類代碼示例

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


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

示例1: setUp

import com.day.cq.commons.Externalizer; //導入依賴的package包/類
@BeforeClass
public static void setUp() {
    CONTEXT.registerService(Externalizer.class, MockExternalizerFactory.getExternalizerService());
    CONTEXT.registerService(AdapterFactory.class, new AdapterFactory() {
                @Override
                public <AdapterType> AdapterType getAdapter(@Nonnull Object o, @Nonnull Class<AdapterType> clazz) {
                    Object result = null;
                    switch (clazz.getName()) {
                        case CLASS_PRODUCT:
                            if (o instanceof Resource) {
                                result = MockCommerceFactory.getProduct((Resource) o);
                            }
                            break;
                        case CLASS_COMMERCE_SERVICE:
                            if (o instanceof Resource) {
                                result = MockCommerceFactory.getCommerceService((Resource) o);
                            }
                            break;
                        case CLASS_XF_SOCIAL_VARIATION:
                            if (o instanceof Page) {
                                result = MockXFFactory.getExperienceFragmentSocialVariation((Page) o);
                            }
                    }

                    return (AdapterType) result;
                }
            },
        new HashMap<String, Object>(){{
            put(AdapterFactory.ADAPTABLE_CLASSES, new String[] {
                    CLASS_RESOURCE,
                    CLASS_PAGE
            });
            put(AdapterFactory.ADAPTER_CLASSES, new String[] {
                    CLASS_PRODUCT,
                    CLASS_COMMERCE_SERVICE,
                    CLASS_XF_SOCIAL_VARIATION
            });
        }}
    );
}
 
開發者ID:Adobe-Marketing-Cloud,項目名稱:aem-core-wcm-components,代碼行數:41,代碼來源:SocialMediaHelperImplTest.java

示例2: configure

import com.day.cq.commons.Externalizer; //導入依賴的package包/類
public static synchronized void configure(SlingSettingsService slingSettings) throws ConfigurationException {

        runmodes = slingSettings.getRunModes();
        isAuthor = runmodes.contains(Externalizer.AUTHOR);
        isPublish = runmodes.contains(Externalizer.PUBLISH);
        if (isAuthor && isPublish) {
            throw new ConfigurationException(null,
                    "Either 'author' or 'publish' run modes may be specified, not both.");
        }
    }
 
開發者ID:Adobe-Consulting-Services,項目名稱:acs-aem-commons,代碼行數:11,代碼來源:ModeUtil.java

示例3: getExternalizerService

import com.day.cq.commons.Externalizer; //導入依賴的package包/類
public static Externalizer getExternalizerService() {
    Externalizer externalizer = mock(Externalizer.class);
    when(externalizer.publishLink(any(ResourceResolver.class), anyString())).then(
            invocationOnMock -> ROOT + invocationOnMock.getArgumentAt(1, String.class));
    return externalizer;
}
 
開發者ID:Adobe-Marketing-Cloud,項目名稱:aem-core-wcm-components,代碼行數:7,代碼來源:MockExternalizerFactory.java


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