本文整理匯總了Java中com.esri.ges.core.geoevent.FieldCardinality類的典型用法代碼示例。如果您正苦於以下問題:Java FieldCardinality類的具體用法?Java FieldCardinality怎麽用?Java FieldCardinality使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FieldCardinality類屬於com.esri.ges.core.geoevent包,在下文中一共展示了FieldCardinality類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: process
import com.esri.ges.core.geoevent.FieldCardinality; //導入依賴的package包/類
@Override
public GeoEvent process(GeoEvent geoEvent) throws Exception
{
String owner = geoEvent.getGeoEventDefinition().getOwner();
GeoEventDefinition ged = geoEventCreator.getGeoEventDefinitionManager().searchGeoEventDefinition(geoEventName, owner);
if(ged==null)
{
LOG.error("Cannot find the GeoEvent Definition " + geoEventName + " with owner " + owner);
return null;
}
FieldDefinition fieldDef = geoEvent.getGeoEventDefinition().getFieldDefinition(geoEventName);
if(fieldDef.getType() != FieldType.Group)
{
LOG.error("Corresponding field is not a group field.");
return null;
}
List<FieldGroup> fieldGroups = new ArrayList<FieldGroup>();
if(fieldDef.getCardinality()==FieldCardinality.Many)
{
fieldGroups = geoEvent.getFieldGroups(geoEventName);
}
else
{
fieldGroups.add(geoEvent.getFieldGroup(geoEventName));
}
for(FieldGroup fg : fieldGroups)
{
GeoEvent event = geoEventCreator.create(ged.getGuid());
for(FieldDefinition fd : ged.getFieldDefinitions())
{
event.setField(fd.getName(), fg.getField(fd.getName()));
}
event.setProperty(GeoEventPropertyName.TYPE, "event");
event.setProperty(GeoEventPropertyName.OWNER_ID, getId());
event.setProperty(GeoEventPropertyName.OWNER_URI, definition.getUri());
send(event);
}
return null;
}