本文整理汇总了Java中com.esri.ges.core.geoevent.FieldType.Group方法的典型用法代码示例。如果您正苦于以下问题:Java FieldType.Group方法的具体用法?Java FieldType.Group怎么用?Java FieldType.Group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.ges.core.geoevent.FieldType
的用法示例。
在下文中一共展示了FieldType.Group方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: traverseFieldGroup
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
private String traverseFieldGroup(FieldDefinition parentFieldDef, StringBuilder sb, FieldGroup fg){
StringBuilder mine=new StringBuilder();
//System.out.println("**Start: "+ parentFieldDef.getName());
for (FieldDefinition fieldDef: parentFieldDef.getChildren()){
if(fieldDef.getType()==FieldType.Group){
//System.out.println("Found another Group:"+ fieldDef.getName());
try {
mine.append("<"+fieldDef.getName()+getAttributes(fieldDef,mine,fg.getFieldGroup(fieldDef.getName()))+">"+traverseFieldGroup(fieldDef,mine,fg.getFieldGroup(fieldDef.getName()))+"</"+fieldDef.getName()+">");
} catch (FieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
//System.out.println("not a group:" + fieldDef.getName()+"="+fg.getField(fieldDef.getName())+ " toString: "+ fieldDef.toString());
if(fg.getField(fieldDef.getName())!=null){
if (fieldDef.getName().equals("#text"))
mine.append(fg.getField(fieldDef.getName()));
}
}
}
//System.out.println("**End: "+ parentFieldDef.getName());
return mine.toString();
}
示例2: report
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
private static void report( int indent, FieldDefinition def )
{
for( int i = 0; i < indent; i++ )
System.out.print(" ");
System.out.println( def );
if( def.getType() == FieldType.Group )
{
for( FieldDefinition child : def.getChildren() )
report( indent + 4, child);
}
}
示例3: main
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
public static void main( String[] args )
{
try
{
//GeoEventDefinition cotDef = new DefaultGeoEventDefinition();
FieldDefinition detailsField = new DefaultFieldDefinition("detail", FieldType.Group);
CoTAdapterService service = new CoTAdapterService();
service.getAdditionalSchemasFromXSDFolder(detailsField);
report(0,detailsField);
} catch (ConfigurationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例4: getAttributes
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
private String getAttributes(FieldDefinition parentFieldDef, StringBuilder sb, FieldGroup fg){
StringBuilder mine=new StringBuilder();
for (FieldDefinition fieldDef: parentFieldDef.getChildren()){
if(fieldDef.getType()!=FieldType.Group){
if(fg.getField(fieldDef.getName())!=null){
if (!fieldDef.getName().equals("#text"))
mine.append(" "+fieldDef.getName()+"=\""+fg.getField(fieldDef.getName())+"\"");
}
}
}
return mine.toString();
}
示例5: CoTAdapterService
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
public CoTAdapterService()
{
super(AdapterType.INBOUND);
try {
try
{
propertyDefinitions.put(COT_TYPES_PATH_LABEL, new PropertyDefinition(COT_TYPES_PATH_LABEL, PropertyType.String, "", "CoT Types Path", "This is the complete path for the cot types file.", false, false) );
propertyDefinitions.put(XSD_PATH_LABEL, new PropertyDefinition(XSD_PATH_LABEL, PropertyType.String, "", "XSD_Path", "This directory is where additional xsd files can be installed. When the Adapter is installed, any xsd files found in this folder are used to add schema elements to the CoT GeoEvent Definition.", false, false ) );
propertyDefinitions.put(MAXIMUM_BUFFER_SIZE_LABEL, new PropertyDefinition(MAXIMUM_BUFFER_SIZE_LABEL, PropertyType.Integer, ""+(1024*1024), "Maximum Buffer Size", "This is the maximum number of XML characters that will be stored in memory while looking for a complete Cursor on Target message. If the adapter receives more than this amount of text, it will assume that it has somehow missed the end of the message, and it will scan for something that looks like the beginning of a new message.", false, false ) );
} catch (PropertyException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
FieldDefinition detailField = new DefaultFieldDefinition("detail", FieldType.Group);
getBuiltInSchemas(detailField);
// INCLUDE the following line if we want to convert CoTTypes to
// human readable. - NOTE load from JAR is OK.
// coTHash=CoTUtilities.getCoTTypeMap(this.getClass().getResourceAsStream("/CoTTypes/CoTtypes.xml"));
// INCLUDE the following line if we are going to extract attributes
// from XSD files. -NOTE problem loading from JAR
getAdditionalSchemasFromXSDFolder(detailField);
GeoEventDefinition geoEventDefinition = new DefaultGeoEventDefinition();
geoEventDefinition.setName("CoT");
this.fieldDefinitions = new ArrayList<FieldDefinition>();
fieldDefinitions.add(new DefaultFieldDefinition("version",
FieldType.Double));
fieldDefinitions.add(new DefaultFieldDefinition("uid",
FieldType.String, "TRACK_ID"));
fieldDefinitions.add(new DefaultFieldDefinition("type",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("2525b",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"typeDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("how",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"parsedhow", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("time",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("start",
FieldType.Date, "TIME_START"));
fieldDefinitions.add(new DefaultFieldDefinition("stale",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("access",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("opex",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"opexDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("qos",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"qosDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("point",
FieldType.Geometry, "GEOMETRY"));
fieldDefinitions.add( detailField );
geoEventDefinition.setFieldDefinitions(fieldDefinitions);
geoEventDefinitions.put(geoEventDefinition.getName(),
geoEventDefinition);
guid = geoEventDefinition.getGuid();
} catch (ConfigurationException ex) {
}
}
示例6: CoTInboundAdapterDefinition
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
public CoTInboundAdapterDefinition(AdapterType type) {
super(AdapterType.INBOUND);
try {
try
{
propertyDefinitions.put(COT_TYPES_PATH_LABEL, new PropertyDefinition(COT_TYPES_PATH_LABEL, PropertyType.String, "", "CoT_Types_Path", "This is the complete path for the cot types file.", false, false) );
propertyDefinitions.put(XSD_PATH_LABEL, new PropertyDefinition(XSD_PATH_LABEL, PropertyType.String, "", "XSD_Path", "This directory is where additional xsd files can be installed. When the Adapter is installed, any xsd files found in this folder are used to add schema elements to the CoT GeoEvent Definition.", false, false ) );
propertyDefinitions.put(MAXIMUM_BUFFER_SIZE_LABEL, new PropertyDefinition(MAXIMUM_BUFFER_SIZE_LABEL, PropertyType.Integer, ""+(1024*1024), "Maximum Buffer Size", "This is the maximum number of XML characters that will be stored in memory while looking for a complete Cursor on Target message. If the adapter receives more than this amount of text, it will assume that it has somehow missed the end of the message, and it will scan for something that looks like the beginning of a new message.", false, false ) );
} catch (PropertyException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
FieldDefinition detailField = new DefaultFieldDefinition("detail", FieldType.Group);
getBuiltInSchemas(detailField);
// INCLUDE the following line if we want to convert CoTTypes to
// human readable. - NOTE load from JAR is OK.
// coTHash=CoTUtilities.getCoTTypeMap(this.getClass().getResourceAsStream("/CoTTypes/CoTtypes.xml"));
// INCLUDE the following line if we are going to extract attributes
// from XSD files. -NOTE problem loading from JAR
getAdditionalSchemasFromXSDFolder(detailField);
GeoEventDefinition geoEventDefinition = new DefaultGeoEventDefinition();
geoEventDefinition.setName("CoT");
this.fieldDefinitions = new ArrayList<FieldDefinition>();
fieldDefinitions.add(new DefaultFieldDefinition("version",
FieldType.Double));
fieldDefinitions.add(new DefaultFieldDefinition("uid",
FieldType.String, "TRACK_ID"));
fieldDefinitions.add(new DefaultFieldDefinition("type",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("2525b",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"typeDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("how",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"parsedhow", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("time",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("start",
FieldType.Date, "TIME_START"));
fieldDefinitions.add(new DefaultFieldDefinition("stale",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("access",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("opex",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"opexDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("qos",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"qosDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("point",
FieldType.Geometry, "GEOMETRY"));
fieldDefinitions.add( detailField );
geoEventDefinition.setFieldDefinitions(fieldDefinitions);
geoEventDefinitions.put(geoEventDefinition.getName(),
geoEventDefinition);
guid = geoEventDefinition.getGuid();
} catch (ConfigurationException ex) {
}
}
示例7: CoTInboundAdapterDefinition
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的package包/类
public CoTInboundAdapterDefinition(AdapterType type) {
super(AdapterType.INBOUND);
try {
try
{
propertyDefinitions.put(COT_TYPES_PATH_LABEL, new PropertyDefinition(COT_TYPES_PATH_LABEL, PropertyType.String, "", lblCotTypes, descCotTypes, false, false) );
propertyDefinitions.put(XSD_PATH_LABEL, new PropertyDefinition(XSD_PATH_LABEL, PropertyType.String, "", lblXSDPath, descXSDPath, false, false ) );
propertyDefinitions.put(MAXIMUM_BUFFER_SIZE_LABEL, new PropertyDefinition(MAXIMUM_BUFFER_SIZE_LABEL, PropertyType.Integer, ""+(1024*1024), lblMaxBuffer, descMaxBuffer, false, false ) );
} catch (PropertyException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
FieldDefinition detailField = new DefaultFieldDefinition("detail", FieldType.Group);
getBuiltInSchemas(detailField);
// INCLUDE the following line if we want to convert CoTTypes to
// human readable. - NOTE load from JAR is OK.
// coTHash=CoTUtilities.getCoTTypeMap(this.getClass().getResourceAsStream("/CoTTypes/CoTtypes.xml"));
// INCLUDE the following line if we are going to extract attributes
// from XSD files. -NOTE problem loading from JAR
getAdditionalSchemasFromXSDFolder(detailField);
GeoEventDefinition geoEventDefinition = new DefaultGeoEventDefinition();
geoEventDefinition.setName("CoT");
this.fieldDefinitions = new ArrayList<FieldDefinition>();
fieldDefinitions.add(new DefaultFieldDefinition("version",
FieldType.Double));
fieldDefinitions.add(new DefaultFieldDefinition("uid",
FieldType.String, "TRACK_ID"));
fieldDefinitions.add(new DefaultFieldDefinition("type",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("2525b",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"typeDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("how",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"parsedhow", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("time",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("start",
FieldType.Date, "TIME_START"));
fieldDefinitions.add(new DefaultFieldDefinition("stale",
FieldType.Date));
fieldDefinitions.add(new DefaultFieldDefinition("access",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("opex",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"opexDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("qos",
FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition(
"qosDescription", FieldType.String));
fieldDefinitions.add(new DefaultFieldDefinition("point",
FieldType.Geometry, "GEOMETRY"));
fieldDefinitions.add( detailField );
geoEventDefinition.setFieldDefinitions(fieldDefinitions);
geoEventDefinitions.put(geoEventDefinition.getName(),
geoEventDefinition);
guid = geoEventDefinition.getGuid();
} catch (ConfigurationException ex) {
}
}
示例8: process
import com.esri.ges.core.geoevent.FieldType; //导入方法依赖的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;
}