• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Validator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.esri.ges.util.Validator的典型用法代码示例。如果您正苦于以下问题:Java Validator类的具体用法?Java Validator怎么用?Java Validator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Validator类属于com.esri.ges.util包,在下文中一共展示了Validator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTrackIdAsString

import com.esri.ges.util.Validator; //导入依赖的package包/类
private String getTrackIdAsString(JsonNode trackIDNode)
{
	String output = null;
	if (trackIDNode.isTextual())
		output = trackIDNode.getTextValue();
	else if (trackIDNode.isInt())
		output = Integer.toString(trackIDNode.getIntValue());
	else if (trackIDNode.isLong())
		output = Long.toString(trackIDNode.getLongValue());
	else if (trackIDNode.isDouble())
		output = Double.toString(trackIDNode.getDoubleValue());
	else if (trackIDNode.isFloatingPointNumber())
		output = trackIDNode.getDecimalValue().toString();

	if (!Validator.isEmpty(output))
	{
		output = output.replace("'", "''");
	}
	return output;
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:21,代码来源:MLOBIOutboundTransport.java


示例2: afterPropertiesSet

import com.esri.ges.util.Validator; //导入依赖的package包/类
public void afterPropertiesSet()
{
  newGeoEventDefinitionName = getProperty("newGeoEventDefinitionName").getValueAsString();
  distanceUnit = getProperty("distanceUnit").getValueAsString();
  geometryType = getProperty("geometryType").getValueAsString();
  notificationMode = Validator.valueOfIgnoreCase(MotionCalculatorNotificationMode.class, getProperty("notificationMode").getValueAsString(), MotionCalculatorNotificationMode.OnChange);
  reportInterval = Converter.convertToInteger(getProperty("reportInterval").getValueAsString(), 10) * 1000;
  autoResetCache = Converter.convertToBoolean(getProperty("autoResetCache").getValueAsString());
  clearCache = Converter.convertToBoolean(getProperty("clearCache").getValueAsString());

  predictiveGeometryType = getProperty("predictiveGeometryType").getValueAsString();
// kept conversion to Int but removed multiplier. Time values were already in milliseconds
  predictiveTimespan = Converter.convertToInteger(getProperty("predictiveTimespan").getValueAsString(), 10) ;

  String[] resetTimeStr = getProperty("resetTime").getValueAsString().split(":");
  // Get the Date corresponding to 11:01:00 pm today.
  Calendar calendar = Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(resetTimeStr[0]));
  calendar.set(Calendar.MINUTE, Integer.parseInt(resetTimeStr[1]));
  calendar.set(Calendar.SECOND, Integer.parseInt(resetTimeStr[2]));
  resetTime = calendar.getTime();
}
 
开发者ID:Esri,项目名称:motion-calculator-for-geoevent,代码行数:23,代码来源:MotionCalculator.java


示例3: unassign

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public List<Stop> unassign( List<String> stopNames )
{
  List<Stop> newStops = null;
  
  if( !Validator.isEmpty( stopNames ) )
  {
    Stop stop;
    DefaultStop newStop;
    newStops = new ArrayList<Stop>();
    for( String stopName : stopNames )
    {
      stop = stopsByStopName.get( stopName );
      if( stop != null )
      {
        newStop = new DefaultStop( stop );
        newStop.setRouteName( getUnassignedRouteName() );
        newStop.setStatus( StopStatus.Unassigned );
        newStop.setSequenceNumber(0);
        newStops.add( newStop );
      }
    }
  }
  return newStops;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:26,代码来源:StopsManagerImpl.java


示例4: getNextStop

import com.esri.ges.util.Validator; //导入依赖的package包/类
private Stop getNextStop(String trackId)
{
  Vehicle vehicle = vehiclesManager.getVehicleByName( trackId );
  List<Stop> stopsForVehicle = stopsManager.getStopsByRouteName( trackId );
  if( vehicle == null || Validator.isEmpty( stopsForVehicle ) )
  {
    return null;
  }
  if(vehicle.getNextStopSequenceNumber()==null)
    resetVehicleNextSequenceNumber();
  Integer nextStopSequenceNumber = vehicle.getNextStopSequenceNumber();
  if( nextStopSequenceNumber > stopsForVehicle.size() )
  {
    return null;
  }
  return stopsForVehicle.get( nextStopSequenceNumber );
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:18,代码来源:AutoArrivalDepartureProcessor.java


示例5: afterPropertiesSet

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void afterPropertiesSet()
{
	expression = getProperty("expression").getValueAsString().trim();
	fieldName = null;
	resultDestination = Validator.valueOfIgnoreCase(ResultDestination.class, getProperty("resultDestination").getValueAsString(), null);
	geoEventMutator = false;
	if (resultDestination != null)
		if (ResultDestination.NEW_FIELD.equals(resultDestination))
		{
			fieldName = getProperty("newFieldName").getValueAsString().trim();
			fieldTagName = Validator.compactSpaces(getProperty("newFieldTag").getValueAsString()).trim();
		}
		else if (ResultDestination.EXISTING_FIELD.equals(resultDestination))
		{
			fieldName = getProperty("existingFieldName").getValueAsString().trim();
			geoEventMutator = true;
		}
	fieldType = Validator.valueOfIgnoreCase(FieldType.class, getProperty("newFieldType").getValueAsString().trim(), null);
	geoEventDefinitionName = getProperty("newGeoEventDefinitionName").getValueAsString().trim();
	fieldDefinition = null;
}
 
开发者ID:Esri,项目名称:solutions-geoevent-java,代码行数:23,代码来源:CacheAwareFieldCalculator.java


示例6: afterPropertiesSet

import com.esri.ges.util.Validator; //导入依赖的package包/类
public void afterPropertiesSet() {
	notificationMode = Validator.valueOfIgnoreCase(
			TrackIdleProcessorNotificationMode.class,
			getProperty("notificationMode").getValueAsString(),
			TrackIdleProcessorNotificationMode.OnChange);
	idleLimit = Converter.convertToInteger(getProperty("idleLimit")
			.getValueAsString(), 300);
	tolerance = Converter.convertToLong(getProperty("tolerance")
			.getValueAsString(), 50l);
	keepFields = (Boolean) getProperty("keepfields").getValue();
	outDefName = getProperty("outdefname").getValueAsString();


	fds = new ArrayList<FieldDefinition>();
	
	try {
		//fds.add(new DefaultFieldDefinition("trackId", FieldType.String,
				//"TRACK_ID"));
		fds.add(new DefaultFieldDefinition("idle", FieldType.Boolean));
		fds.add(new DefaultFieldDefinition("idleDuration", FieldType.Double));
		fds.add(new DefaultFieldDefinition("idleStart", FieldType.Date));
		//fds.add(new DefaultFieldDefinition("geometry", FieldType.Geometry));

		if ((ged = manager.searchGeoEventDefinition(outDefName, definition.getUri().toString())) == null)
		{
			createDef = true;
		}
	} catch (ConfigurationException e) {

	}

	// geoEventDefinitions.put(ged.getName(), ged);
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:34,代码来源:TrackIdleProcessor.java


示例7: getAreaAroundPoint

import com.esri.ges.util.Validator; //导入依赖的package包/类
public MapGeometry getAreaAroundPoint(MapGeometry point)
{
	ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(naConnectionName);

	Collection<KeyValue> params = new ArrayList<KeyValue>();
	params.addAll(getDefaultParamsForRequest(agsConnection));
   //params.addAll(agsConnection.getDefaultParamsForRequest());
	params.add(new KeyValue("facilities", generateFacilitiesJson(point)));
	params.add(new KeyValue("defaultBreaks", (new Integer(driveTime)).toString()));
	params.add(new KeyValue("travelDirection", "esriNATravelDirectionFromFacility"));

	if (!Validator.isEmpty(outputPolygonType))
		params.add(new KeyValue("outputPolygons", outputPolygonType));

	try (GeoEventHttpClient http = httpService.createNewClient())
	{
		StringBuffer urlString = new StringBuffer();
		urlString.append(agsConnection.getUrl().toExternalForm());
		urlString.append(serviceAreaSolverPath);

		URL url = new URL(urlString.toString());
		//HttpPost postRequest = http.createPostRequest(url, params);
     HttpPost postRequest = createPostRequest(url, params);
		postRequest.addHeader("Referer", agsConnection.getReferer());
		String responseString = http.executeAndReturnBody(postRequest, GeoEventHttpClient.DEFAULT_TIMEOUT);
		/*
		HttpGet getRequest = http.createGetRequest(url, params);
		getRequest.addHeader("Referer", agsConnection.getReferer());
     String responseString = http.executeAndReturnBody(getRequest, GeoEventHttpClient.DEFAULT_TIMEOUT);
		*/
		return parseAreaSolverReply(responseString);
	}
	catch (Exception e)
	{
		LOGGER.debug("SERVICE_AREA_UNABLE_ERROR1", e.getMessage());
		LOGGER.info(e.getMessage(), e);
	}

	return null;
}
 
开发者ID:Esri,项目名称:service-area-calculator-for-geoevent,代码行数:41,代码来源:ServiceAreaCalculator.java


示例8: RabbitMQQueue

import com.esri.ges.util.Validator; //导入依赖的package包/类
public RabbitMQQueue(String name, String durability, String exclusive, String autoDelete)
{
	this.name = name;
	this.durability = Validator.valueOfIgnoreCase(RabbitMQDurability.class, durability, RabbitMQDurability.Transient);
	this.exclusive = Converter.convertToBoolean(exclusive, false);
	this.autoDelete = Converter.convertToBoolean(autoDelete, true);
}
 
开发者ID:Esri,项目名称:rabbitmq-for-geoevent,代码行数:8,代码来源:RabbitMQQueue.java


示例9: RabbitMQExchange

import com.esri.ges.util.Validator; //导入依赖的package包/类
public RabbitMQExchange(String name, String type, String durability, String autoDelete, String routingKey)
{
	this.name = name;
	this.type = Validator.valueOfIgnoreCase(RabbitMQExchangeType.class, type, RabbitMQExchangeType.direct);
	this.durability = Validator.valueOfIgnoreCase(RabbitMQDurability.class, durability, RabbitMQDurability.Transient);
	this.autoDelete = Converter.convertToBoolean(autoDelete, true);
	this.routingKey = routingKey;
}
 
开发者ID:Esri,项目名称:rabbitmq-for-geoevent,代码行数:9,代码来源:RabbitMQExchange.java


示例10: afterPropertiesSet

import com.esri.ges.util.Validator; //导入依赖的package包/类
public void afterPropertiesSet()
{
	// read properties
	notificationMode = Validator.valueOfIgnoreCase(TrackIdleNotificationMode.class, getProperty("notificationMode").getValueAsString(), TrackIdleNotificationMode.OnChange);
	idleLimit = Converter.convertToInteger(getProperty("idleLimit").getValueAsString(), 300);
	tolerance = Converter.convertToLong(getProperty("tolerance").getValueAsString(), 50l);
	keepFields = (Boolean) getProperty("keepFields").getValue();
	outGedSuffixName = getProperty("outGedSuffixName").getValueAsString();
	accumulateIdleDuration = (Boolean) getProperty("accumulateIdleDuration").getValue();
	reportIdleDurationWhileNotIdle = (Boolean) getProperty("reportIdleDurationWhileNotIdle").getValue();

	// get the "TrackIdle" GED
	trackIdleGed = gedManager.searchGeoEventDefinition(TrackIdleDetectorDefinition.DEFAULT_TRACK_IDLE_GED_NAME, definition.getUri().toString());

	// prepare to augment track idle fields to a GED
	trackIdleFields = new ArrayList<FieldDefinition>();
	try
	{
		trackIdleFields.add(new DefaultFieldDefinition("idle", FieldType.Boolean));
		trackIdleFields.add(new DefaultFieldDefinition("idleDuration", FieldType.Double));
		trackIdleFields.add(new DefaultFieldDefinition("idleStart", FieldType.Date));
	}
	catch (ConfigurationException error)
	{
		LOGGER.error(error.getMessage(), error);
	}
}
 
开发者ID:Esri,项目名称:track-idle-detector-for-geoevent,代码行数:28,代码来源:TrackIdleDetector.java


示例11: getStopsByRouteName

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public List<Stop> getStopsByRouteName(String key)
{
  List<Stop> list = new ArrayList<Stop>();
  if (stopsByRouteName.containsKey(key))
  {
    List<StopResource> stopResources = stopsByRouteName.get(key);
    if( !Validator.isEmpty( stopResources ) )
    {
      list.addAll( stopResources );
    }
  }
  return list;
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:15,代码来源:StopsManagerImpl.java


示例12: batchAddOrReplaceStops

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void batchAddOrReplaceStops( List<Stop> stops )
{
  if( !Validator.isEmpty( stops ) )
  {
    Stop updatedStop;
    for( Stop stop : stops )
    {
      updatedStop = addOrReplaceInLocalMaps( stop );
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:13,代码来源:StopsManagerImpl.java


示例13: clearAllStops

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void clearAllStops(String agsConnectionName, String path, String featureService, String stopLayer, String geofenceLayer)
{
  ArcGISServerConnection agsConnection = agsConnectionManager.getArcGISServerConnection(agsConnectionName);
  Layer stoplyr =  agsConnection.getLayer(path, featureService, stopLayer, ArcGISServerType.FeatureServer);
  agsConnection.deleteAllRecordsFromLayer(path , featureService, stoplyr.getId());
  removeAllStops();
  
  if(!Validator.isEmpty(geofenceLayer))
  {
    Layer geofencelyr = agsConnection.getLayer(path, featureService, geofenceLayer, ArcGISServerType.FeatureServer);
    agsConnection.deleteAllRecordsFromLayer(path , featureService, geofencelyr.getId());
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:15,代码来源:StopsManagerImpl.java


示例14: setAttribute

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void setAttribute(String key, String value)
{
    if( Validator.isEmpty( key ) || Validator.isEmpty( value ) )
    {
      return;
    }
    setAttribute(resource, key, value);
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:10,代码来源:StopResource.java


示例15: setAttribute

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void setAttribute(String key, String value)
{
  if( !Validator.isEmpty(key) && !Validator.isEmpty( value ) )
  {
    attributes.put( key, value );
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:9,代码来源:DefaultStop.java


示例16: removeAllVehicles

import com.esri.ges.util.Validator; //导入依赖的package包/类
@Override
public void removeAllVehicles()
{
  Set<String> vehicleKeys = vehicleMap.keySet();
  if( !Validator.isEmpty( vehicleKeys ) )
  {
    VehicleResource vehicle;
    for( String key : vehicleKeys )
    {
      vehicle = vehicleMap.remove( key );
      resourceManager.deleteResource( vehicle.getResource().getId() );
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:15,代码来源:VehiclesManagerImpl.java


示例17: unassign

import com.esri.ges.util.Validator; //导入依赖的package包/类
private void unassign(Collection<CalculateParamsWrapper> params, Plan plan, boolean commit)
{
  List<Stop> unassignedStops = new ArrayList<Stop>();
  if( !Validator.isEmpty( params ) )
  {
    String routeName;
    List<String> stopNames;
    for( CalculateParamsWrapper param : params )
    {
      routeName = param.getRouteName();
      if(routeName.equals(stopsManager.getUnassignedRouteName()))
      {
       stopNames = param.getStops();
        if( !Validator.isEmpty( stopNames )  )
        {
          unassignedStops = stopsManager.unassign(stopNames);
          if( !Validator.isEmpty( unassignedStops ) )
          {
            plan.getStops().addAll(unassignedStops);
            if(commit)
              stopsManager.batchAddOrReplaceStops(unassignedStops);
          }
        }
      }
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:28,代码来源:RouteManagerImpl.java


示例18: createOpenSpatialConditionForStop

import com.esri.ges.util.Validator; //导入依赖的package包/类
private StopIncidentConditions createOpenSpatialConditionForStop( Stop stop )
  {
    StopIncidentConditions retConditions = new StopIncidentConditions();
    SpatialCondition condition = null;
    ConditionService service = conditionRegistry.getCondition("spatialCondition");
    if (service == null)
      throw new RuntimeException("Spatial conditions are not currently supported: bundle 'Esri :: AGES :: Condition :: Spatial' is not registered.");
    try
    {
//      String geoFenceString = stopsManager.getStopsAoiCategory()+"/"+stop.getName();
      String geoFenceString = stopsManager.getStopsAoiCategory()+"/"+Validator.normalizeName(stop.getName());
      condition = (SpatialCondition)service.create();
      condition.setGeofence( geoFenceString );
      condition.setOperator( SpatialOperator.INSIDE );
      condition.setOperand("GEOMETRY");
      condition.setGeoEventCache( geoEventCache );
      retConditions.open = condition;
      condition = (SpatialCondition)service.create();
      condition.setGeofence( geoFenceString );
      condition.setOperator( SpatialOperator.OUTSIDE );
      condition.setOperand("GEOMETRY");
      condition.setGeoEventCache( geoEventCache );
      retConditions.close = condition;
    }
    catch( Exception e)
    {
      throw new RuntimeException(e.getMessage());
    }
    return retConditions;
  }
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:31,代码来源:AutoArrivalDepartureProcessor.java


示例19: getNextStop

import com.esri.ges.util.Validator; //导入依赖的package包/类
private Stop getNextStop(String trackId)
{
  Vehicle vehicle = vehiclesManager.getVehicleByName( trackId );
  List<Stop> stopsForVehicle = stopsManager.getStopsByRouteName( trackId );
  if( vehicle == null || Validator.isEmpty( stopsForVehicle ) )
  {
    return null;
  }
  Integer nextStopSequenceNumber = vehicle.getNextStopSequenceNumber();
  if( nextStopSequenceNumber > stopsForVehicle.size() )
  {
    return null;
  }
  return stopsForVehicle.get( nextStopSequenceNumber );
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:16,代码来源:EtaCalculator.java


示例20: getNextStops

import com.esri.ges.util.Validator; //导入依赖的package包/类
private List<Stop> getNextStops(String trackId)
{
  Vehicle vehicle = vehiclesManager.getVehicleByName( trackId );
  List<Stop> stopsForVehicle = stopsManager.getStopsByRouteName( trackId );
  if( vehicle == null || Validator.isEmpty( stopsForVehicle ) )
  {
    return null;
  }
  Integer nextStopSequenceNumber = vehicle.getNextStopSequenceNumber();
  if( nextStopSequenceNumber > stopsForVehicle.size() )
  {
    return null;
  }
  return stopsForVehicle.subList(nextStopSequenceNumber, stopsForVehicle.size());
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:16,代码来源:EtaCalculator.java



注:本文中的com.esri.ges.util.Validator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MemoryDeferredOutputStream类代码示例发布时间:2022-05-22
下一篇:
Java ActivationOS类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap