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


Java ECGroupSpec類代碼示例

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


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

示例1: checkGroupSpec

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
/**
 * check the group spec patterns do not have intersecting groups -> all group patterns have to be disjoint:<br/>
 * <ul>
 * 	<li>the same pattern is not allowed to occur twice</li>
 * 	<li>two different pattern with intersecting selectors are not allowed</li>
 * 	<li>no pattern at all is allowed</li>
 * </ul>
 * @param groupSpec the group spec to tested.
 * @throws ECSpecValidationException upon violation.
 * @return true if filter group spec is valid. exception otherwise.
 */
public boolean checkGroupSpec(ECGroupSpec groupSpec) throws ECSpecValidationException {
	if (groupSpec != null) {
		String[] patterns = groupSpec.getPattern().toArray(new String[] {});
		for (int i=0; i<patterns.length-1; i++) {
			final String pattern1 = patterns[i];
			for (int j=i+1; j<patterns.length; j++) {
				final String pattern2 = patterns[j];
				if (!patternDisjoint(pattern1, pattern2)) {
					throw logAndCreateECSpecValidationException("The two grouping patterns '" + pattern1 + "' and '" + pattern2 + "' are not disjoint.");
				}
			}
		}
	}
	return true;
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:27,代碼來源:ECSpecValidator.java

示例2: createECReportSpec

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
public static ECReportSpec createECReportSpec() {
	
	// create spec
	ECReportSpec spec = new ECReportSpec();
	
	// set paramteters
	spec.setReportName(REPORT_NAME);
	spec.setReportOnlyOnChange(REPORT_ONLY_ON_CHANGE);
	spec.setReportIfEmpty(REPORT_IF_EMPTY);
	spec.setReportSet(createECReportSetSpec());
	spec.setFilterSpec(createECFilterSpec());
	spec.setGroupSpec(new ECGroupSpec());
	spec.getGroupSpec().getPattern().addAll(GROUP_PATTERNS);
	spec.setOutput(createECReportOutputSpec());
	
	return spec;
	
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:19,代碼來源:ECElementsUtils.java

示例3: checkGroupSpec

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
/**
 * check the group spec patterns do not have intersecting groups -> all group patterns have to be disjoint:<br/>
 * <ul>
 * 	<li>the same pattern is not allowed to occur twice</li>
 * 	<li>two different pattern with intersecting selectors are not allowed</li>
 * 	<li>no pattern at all is allowed</li>
 * </ul>
 * @param groupSpec the group spec to tested.
 * @throws ECSpecValidationException upon violation.
 * @return true if filter group spec is valid. exception otherwise.
 */
public boolean checkGroupSpec(ECGroupSpec groupSpec) throws ECSpecValidationException {
	if (groupSpec != null) {
		String[] patterns = groupSpec.getPattern().toArray(new String[] {});
		for (int i=0; i<patterns.length-1; i++) {
			final String pattern1 = patterns[i];
			for (int j=i+1; j<patterns.length; j++) {
				final String pattern2 = patterns[j];
				if (!patternDisjoint(pattern1, pattern2)) {
					throw logAndCreateECSpecValidationException("The two grouping patterns '" + pattern1 + "' and '" + pattern2 + "' are not disjoint.");
				}
			}
		}
	}
	
	if (groupSpec != null) {
		if (groupSpec.getPattern() != null) {
			for (String temp : groupSpec.getPattern()) {
				new Pattern(temp, PatternUsage.GROUP);
			}
		}
	}
	return true;
}
 
開發者ID:gs1oliot,項目名稱:oliot-fc,代碼行數:35,代碼來源:ECSpecValidator.java

示例4: testGroupSpec

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
/**
 * test the group spec validation.
 * @throws ECSpecValidationException violation against the specification.
 */
@Test
public void testGroupSpec() throws ECSpecValidationException {
	ECGroupSpec groupSpec = new ECGroupSpec();
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[1-2].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[3-4].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[5-6].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[7-8].*.*");
	Assert.assertTrue(validator.checkGroupSpec(groupSpec));
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:14,代碼來源:ECSpecValidatorTest.java

示例5: testGroupSpecInvalidInput

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
/**
 * test the group spec validation - must throw exception here
 * @throws ECSpecValidationException violation against the specification.
 */
@Test(expected = ECSpecValidationException.class)
public void testGroupSpecInvalidInput() throws ECSpecValidationException {
	ECGroupSpec groupSpec = new ECGroupSpec();
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[1-2].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[1-2].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[5-6].*.*");
	validator.checkGroupSpec(groupSpec);
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:13,代碼來源:ECSpecValidatorTest.java

示例6: testGroupSpecInvalidInput2

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
/**
 * test the group spec validation - must throw exception here
 * @throws ECSpecValidationException violation against the specification.
 */
@Test(expected = ECSpecValidationException.class)
public void testGroupSpecInvalidInput2() throws ECSpecValidationException {
	ECGroupSpec groupSpec = new ECGroupSpec();
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[1-2].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[3-4].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[5-6].*.*");
	groupSpec.getPattern().add("urn:epc:pat:sgtin-64:1.[5-6].*.*");
	validator.checkGroupSpec(groupSpec);
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:14,代碼來源:ECSpecValidatorTest.java

示例7: createDummyReportSpecs

import org.fosstrak.ale.xsd.ale.epcglobal.ECGroupSpec; //導入依賴的package包/類
public ReportSpecs createDummyReportSpecs() {
	ExcludePatterns excludePatterns = new ExcludePatterns();
	excludePatterns.getExcludePattern().add(FILTER_SPEC_EXCLUDE_PATTERN);
	IncludePatterns includePatterns = new IncludePatterns();
	includePatterns.getIncludePattern().add(FILTER_SPEC_INCLUDE_PATTERN);
	ECFilterSpec filterSpec = new ECFilterSpec();
	filterSpec.setExcludePatterns(excludePatterns);
	filterSpec.setIncludePatterns(includePatterns);
	
	ECGroupSpec groupSpec = new ECGroupSpec();
	groupSpec.getPattern().add(GROUP_SPEC_PATTERN);
	
	ECReportOutputSpec outputSpec = new ECReportOutputSpec();
	outputSpec.setIncludeCount(true);
	outputSpec.setIncludeEPC(true);
	outputSpec.setIncludeRawDecimal(true);
	outputSpec.setIncludeRawHex(true);
	outputSpec.setIncludeTag(true);
	
	ECReportSetSpec reportSet = new ECReportSetSpec();
	reportSet.setSet(REPORT_SET);
	
	ECReportSpec reportSpec = new ECReportSpec();
	reportSpec.setFilterSpec(filterSpec);
	reportSpec.setGroupSpec(groupSpec);
	reportSpec.setOutput(outputSpec);
	reportSpec.setReportIfEmpty(true);
	reportSpec.setReportName(REPORT_NAME);
	reportSpec.setReportOnlyOnChange(true);
	reportSpec.setReportSet(reportSet);
	
	ReportSpecs specs = new ReportSpecs();		
	specs.getReportSpec().add(reportSpec);
	return specs;
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:36,代碼來源:SerializerAndDeserializerUtilsTest.java


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