本文整理汇总了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;未经允许,请勿转载。 |
请发表评论