• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java License类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.psdev.licensesdialog.licenses.License的典型用法代码示例。如果您正苦于以下问题:Java License类的具体用法?Java License怎么用?Java License使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



License类属于de.psdev.licensesdialog.licenses包,在下文中一共展示了License类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readNotice

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
private static Notice readNotice(final XmlPullParser parser) throws IOException,
    XmlPullParserException {
    parser.require(XmlPullParser.START_TAG, null, "notice");
    String name = null;
    String url = null;
    String copyright = null;
    License license = null;
    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        final String element = parser.getName();
        if ("name".equals(element)) {
            name = readName(parser);
        } else if ("url".equals(element)) {
            url = readUrl(parser);
        } else if ("copyright".equals(element)) {
            copyright = readCopyright(parser);
        } else if ("license".equals(element)) {
            license = readLicense(parser);
        } else {
            skip(parser);
        }
    }
    return new Notice(name, url, copyright, license);
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:27,代码来源:NoticesXmlParser.java


示例2: read

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public static License read(final String license) {
	final String trimmedLicense = license.trim();
	if (sLicenses.containsKey(trimmedLicense)) {
		return sLicenses.get(trimmedLicense);
	} else {
		throw new IllegalStateException(String.format("no such license available: %s, did you forget to register it?", trimmedLicense));
	}
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:9,代码来源:LicenseResolver.java


示例3: onSingleClick

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public void onSingleClick(final View view) {
    final String name = "LicensesDialog";
    final String url = "http://psdev.de";
    final String copyright = "Copyright 2013 Philip Schiffer <[email protected]>";
    final License license = new ApacheSoftwareLicense20();
    final Notice notice = new Notice(name, url, copyright, license);
    new LicensesDialog.Builder(this)
        .setNotices(notice)
        .build()
        .show();
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:12,代码来源:SampleActivity.java


示例4: onSingleFragmentClick

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public void onSingleFragmentClick(final View view) {
    final String name = "LicensesDialog";
    final String url = "http://psdev.de";
    final String copyright = "Copyright 2013 Philip Schiffer <[email protected]>";
    final License license = new ApacheSoftwareLicense20();
    final Notice notice = new Notice(name, url, copyright, license);

    final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this)
        .setNotice(notice)
        .setIncludeOwnLicense(false)
        .build();

    fragment.show(getSupportFragmentManager(), null);
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:15,代码来源:SampleActivity.java


示例5: onSingleClick

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public void onSingleClick(final View view) {
    final String name = "LicensesDialog";
    final String url = "http://psdev.de";
    final String copyright = "Copyright 2013 Philip Schiffer <[email protected]>";
    final License license = new ApacheSoftwareLicense20();
    final Notice notice = new Notice(name, url, copyright, license);
    new LicensesDialog.Builder(this)
        .setNotices(notice)
        .build()
        .showAppCompat();
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:12,代码来源:AppCompatSampleActivity.java


示例6: onSingleFragmentClick

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public void onSingleFragmentClick(final View view) {
    final String name = "LicensesDialog";
    final String url = "http://psdev.de";
    final String copyright = "Copyright 2013 Philip Schiffer <[email protected]>";
    final License license = new ApacheSoftwareLicense20();
    final Notice notice = new Notice(name, url, copyright, license);

    final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this)
        .setNotice(notice)
        .setIncludeOwnLicense(false)
        .setUseAppCompat(true)
        .build();

    fragment.show(getSupportFragmentManager(), null);
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:16,代码来源:AppCompatSampleActivity.java


示例7: getLicenseText

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
private String getLicenseText(final License license) {
    if (license != null) {
        if (!mLicenseTextCache.containsKey(license)) {
            mLicenseTextCache.put(license, mShowFullLicenseText ? license.getFullText(mContext) : license.getSummaryText(mContext));
        }
        return mLicenseTextCache.get(license);
    }
    return "";
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:10,代码来源:NoticesHtmlBuilder.java


示例8: read

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
/**
 * Get a license by name
 *
 * @param license license name
 * @return License
 * @throws java.lang.IllegalStateException when unknown license is requested
 */
public static License read(final String license) {
    final String trimmedLicense = license.trim();
    if (sLicenses.containsKey(trimmedLicense)) {
        return sLicenses.get(trimmedLicense);
    } else {
        throw new IllegalStateException(String.format("no such license available: %s, did you forget to register it?", trimmedLicense));
    }
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:16,代码来源:LicenseResolver.java


示例9: testRegisterLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
@Test
public void testRegisterLicense() throws Exception {
    LicenseResolver.registerLicense(new TestLicense());
    final License license = LicenseResolver.read(TEST_LICENSE_NAME);
    assertNotNull(license);
    assertEquals(TEST_LICENSE_NAME, license.getName());
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:8,代码来源:LicenseResolverTest.java


示例10: readLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
private static License readLicense(final XmlPullParser parser) throws IOException, XmlPullParserException {
    final String license = readTag(parser, "license");
    return LicenseResolver.read(license);
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:5,代码来源:NoticesXmlParser.java


示例11: getLicenseText

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
private String getLicenseText(final License license) {
    if (license != null) {
        return mShowFullLicenseText ? license.getFullText(mContext) : license.getSummaryText(mContext);
    }
    return "";
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:7,代码来源:NoticesHtmlBuilder.java


示例12: Notice

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public Notice(final String name, final String url, final String copyright, final License license) {
    mName = name;
    mUrl = url;
    mCopyright = copyright;
    mLicense = license;
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:7,代码来源:Notice.java


示例13: setLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public void setLicense(final License license) {
    mLicense = license;
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:4,代码来源:Notice.java


示例14: getLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
public License getLicense() {
    return mLicense;
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:4,代码来源:Notice.java


示例15: testReadKnownLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
@Test
public void testReadKnownLicense() throws Exception {
    final License license = LicenseResolver.read("MIT License");
    assertNotNull(license);
    assertEquals("MIT License", license.getName());
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:7,代码来源:LicenseResolverTest.java


示例16: registerLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
/**
 * Register an additional license.
 * 
 * @param license
 *            the license to register
 */
public static void registerLicense(final License license) {
	sLicenses.put(license.getName(), license);
}
 
开发者ID:guiguito,项目名称:AIRShare,代码行数:10,代码来源:LicenseResolver.java


示例17: registerLicense

import de.psdev.licensesdialog.licenses.License; //导入依赖的package包/类
/**
 * Register an additional license.
 *
 * @param license the license to register
 */
public static void registerLicense(final License license) {
    sLicenses.put(license.getName(), license);
}
 
开发者ID:PSDev,项目名称:LicensesDialog,代码行数:9,代码来源:LicenseResolver.java



注:本文中的de.psdev.licensesdialog.licenses.License类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Flow类代码示例发布时间:2022-05-23
下一篇:
Java Color类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap