本文整理汇总了Java中net.opengis.eml.x001.EMLDocument类的典型用法代码示例。如果您正苦于以下问题:Java EMLDocument类的具体用法?Java EMLDocument怎么用?Java EMLDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EMLDocument类属于net.opengis.eml.x001包,在下文中一共展示了EMLDocument类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateOutput
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
public Object generateOutput(MapEposEvent resultEvent) {
this.eventMap = resultEvent;
if (this.eventMap.containsKey(MapEposEvent.ORIGNIAL_OBJECT_KEY)) {
this.resultEventDoc = EventDocument.Factory.newInstance();
this.resultEventType = this.resultEventDoc.addNewEvent();
}
else {
this.resultDerivedEventDoc = DerivedEventDocument.Factory.newInstance();
this.resultDerivedEventType = this.resultDerivedEventDoc.addNewDerivedEvent();
}
EMLDocument emlDoc = EMLDocument.Factory.newInstance();
emlDoc.setEML(eml);
return generateEventDocument(emlDoc);
}
示例2: generateEventDocument
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
/**
* @param eml if eml available put it in the procedure
* @return XmlObject holding the {@link EventType}
*/
public XmlObject generateEventDocument(EML eml) {
if (this.resultEventType != null) {
generateFromEventType(this.eventMap, this.resultEventType);
return this.resultEventDoc;
}
generateFromEventType(this.eventMap, this.resultDerivedEventType);
if (eml != null) {
EMLDocument doc = EMLDocument.Factory.newInstance();
doc.setEML(eml);
this.resultDerivedEventType.setProcedure(doc);
}
else {
this.resultDerivedEventType.addNewProcedure();
}
return this.resultDerivedEventDoc;
}
示例3: getRuleByEML
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
/**
*
* This method is used to parse an EML file and return a Rule class with rule specific attributes.
* The method is called if user want to edit this rule type.
*
* @param basicRule
* @return {@link Rule}
*/
public Rule getRuleByEML(BasicRule basicRule) {
Rule rule = new Rule();
rule.setTimeseriesMetadata(basicRule.getTimeseriesMetadata());
try {
EMLDocument emlDocument = EMLDocument.Factory.parse(eml);
SimplePatterns simplePatterns = emlDocument.getEML().getSimplePatterns();
setEntryConditions(rule, simplePatterns.getSimplePatternArray(INDEX_ENTRY_CONDITION_PATTERN));
setExitConditions(rule, simplePatterns.getSimplePatternArray(INDEX_EXIT_CONDITION_PATTERN));
rule.setRuleType(SimpleRuleType.OVER_UNDERSHOOT);
} catch (Exception e) {
LOGGER.error("Error parsing EML rule", e);
}
return rule;
}
示例4: createEmlWrapper
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
/**
* Generates an EML document holding one
* simple pattern with the given FilterType.
*
* @param fesFilter an OGC filter encoding 2.0 filter
*
* @return an EML document with a simple pattern using the filter as guard
*/
private static EMLDocument createEmlWrapper(FilterType fesFilter) {
EMLDocument doc = EMLDocument.Factory.newInstance();
EML eml = doc.addNewEML();
eml.addNewComplexPatterns();
eml.addNewRepetitivePatterns();
eml.addNewTimerPatterns();
SimplePatterns simple = eml.addNewSimplePatterns();
SimplePatternType pattern = simple.addNewSimplePattern();
pattern.setPatternID("defaultSimplePattern");
pattern.setInputName("input");
SelectFunctions funcs = pattern.addNewSelectFunctions();
SelectFunctionType func = funcs.addNewSelectFunction();
func.setNewEventName("");
func.setOutputName("output");
SelectEvent selEv = func.addNewSelectEvent();
selEv.setEventName("sensorStream");
ViewType view = pattern.addNewView();
LengthView length = view.addNewLengthView();
length.setEventCount(new BigInteger("1"));
GuardType guard = pattern.addNewGuard();
guard.setFilter(fesFilter);
pattern.addNewPropertyRestrictions();
return doc;
}
示例5: serialize
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
public CharSequence serialize(FilterSerialization serializer) {
if (serializer != null) {
return serializer.serializeFilter(this);
}
EMLDocument doc = EMLDocument.Factory.newInstance();
doc.setEML(this.eml);
return doc.xmlText();
}
示例6: shouldInstantiationEMLPatternFilter
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Test
public void shouldInstantiationEMLPatternFilter() throws XmlException, IOException, FilterInstantiationException {
EMLDocument eml = EMLDocument.Factory.parse(getClass().getResourceAsStream("eml.xml"));
EposFilter filter = FilterInstantiationRepository.Instance.instantiate(eml);
Assert.assertTrue("filter is null!", filter != null);
Assert.assertTrue("Not a PassiveFilter!", filter instanceof EMLPatternFilter);
}
示例7: EML001Impl
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
public EML001Impl(XmlObject eml) {
if (eml instanceof EMLDocument) {
this.eml = (EMLDocument) eml;
}
else {
throw new IllegalArgumentException("Only EML Version 0.0.1 allowed.");
}
}
示例8: generateStaticDocument
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
public static EML001Impl generateStaticDocument(FilterType ogcFilter) {
EMLDocument emlDoc = EMLDocument.Factory.newInstance();
EML eml2 = emlDoc.addNewEML();
eml2.addNewComplexPatterns();
eml2.addNewRepetitivePatterns();
eml2.addNewTimerPatterns();
SimplePatterns simple = eml2.addNewSimplePatterns();
SimplePatternType pattern = simple.addNewSimplePattern();
pattern.setPatternID("defaultSimplePattern");
pattern.setInputName("sensorStream");
SelectFunctions funcs = pattern.addNewSelectFunctions();
SelectFunctionType func = funcs.addNewSelectFunction();
func.setNewEventName("");
func.setOutputName("output");
SelectEvent selEv = func.addNewSelectEvent();
selEv.setEventName("sensorStream");
ViewType view = pattern.addNewView();
LengthView length = view.addNewLengthView();
length.setEventCount(new BigInteger("1"));
GuardType guard = pattern.addNewGuard();
guard.setFilter(ogcFilter);
pattern.addNewPropertyRestrictions();
return new EML001Impl(emlDoc);
}
示例9: instantiateFrom
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
public EposFilter instantiateFrom(Object input) throws Exception {
EMLDocument emlDoc = (EMLDocument) input;
return new EMLPatternFilter(emlDoc);
}
示例10: getSupportedInput
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
public Class<?> getSupportedInput() {
return EMLDocument.class;
}
示例11: EMLPatternFilter
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
public EMLPatternFilter(EMLDocument emlDoc) throws Exception {
this.eml = emlDoc.getEML();
initialize();
}
示例12: getEmlTemplate
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
protected EMLDocument getEmlTemplate() throws MalformedURLException, XmlException, IOException {
URL url = new URL(templatePath);
return EMLDocument.Factory.parse(url.openStream());
}
示例13: getEmlTemplate
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
protected EMLDocument getEmlTemplate() throws MalformedURLException, XmlException, IOException {
return EMLDocument.Factory.parse(getClass().getResourceAsStream("/files/BR_5.xml"));
}
示例14: getEmlTemplate
import net.opengis.eml.x001.EMLDocument; //导入依赖的package包/类
@Override
protected EMLDocument getEmlTemplate() throws MalformedURLException, XmlException, IOException {
return EMLDocument.Factory.parse(getClass().getResourceAsStream("/files/BR_4.xml"));
}