当前位置: 首页>>代码示例>>Java>>正文


Java DateTime.toJavaDate方法代码示例

本文整理汇总了Java中lotus.domino.DateTime.toJavaDate方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.toJavaDate方法的具体用法?Java DateTime.toJavaDate怎么用?Java DateTime.toJavaDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.DateTime的用法示例。


在下文中一共展示了DateTime.toJavaDate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: safeToJavaDate

import lotus.domino.DateTime; //导入方法依赖的package包/类
/**
 * Converts a Notes DateTime to a Java Date. We have problems with date fields with values of FFFFFFFF:FFFFFFFFF
 * since they cause toJavaDate() to choke; we'll catch it here and just return a null.
 * 
 * Borrowed/Adapted - from Traveler
 */
private Date safeToJavaDate(final DateTime date)
{
   Date value = null;
   try
   {
      final String time = date.getTimeOnly();
      if ((time == null) || time.equals(""))
      {
         DateTime workingDate = date.getParent().createDateTime(date.getDateOnly() + " 00:00:00 GMT"); //$NON-NLS-1$
         value = workingDate.toJavaDate();
         workingDate.recycle();
         workingDate = null;
      }
      else
      {
         value = date.toJavaDate();
      }
   }
   catch (final NotesException notesEx)
   {
      // If there was an error we'll just return a null
   }

   return value;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:32,代码来源:RecentContactsProvider.java

示例2: toJavaDate

import lotus.domino.DateTime; //导入方法依赖的package包/类
public Date toJavaDate(DateTime value) throws IOException {
    try {
        return value.toJavaDate();
    } catch(NotesException ex) {
        throw new AbstractIOException(ex,"");
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:8,代码来源:XmlWriter.java

示例3: toJavaDate

import lotus.domino.DateTime; //导入方法依赖的package包/类
public Date toJavaDate(DateTime value) throws IOException {
try {
	return value.toJavaDate();
} catch(NotesException ex) {
	throw new AbstractIOException(ex,"");
}
  }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:8,代码来源:JsonBuilder.java

示例4: getDate

import lotus.domino.DateTime; //导入方法依赖的package包/类
public Date getDate() {
	try {
		DateTime dt = (DateTime) note.getItemValueDateTimeArray("$TemplateBuildDate").get(0);
		return dt.toJavaDate();
	} catch (NotesException e) {
		return null;
	}
}
 
开发者ID:majkilde,项目名称:LogFileReader,代码行数:9,代码来源:TemplateVersion.java

示例5: bind

import lotus.domino.DateTime; //导入方法依赖的package包/类
public void bind(Document doc, Object bean){
	ReflectionUtils reflect = new ReflectionUtils();
	PropertyDescriptor[] props = reflect.getProperties(bean);
	
	try {
		for(PropertyDescriptor prop : props){
			Vector values =doc.getItemValue(prop.getName());
			Object value = values.elementAt(0);
			
			if(value instanceof DateTime){
				DateTime dt = (DateTime) value;
				value = dt.toJavaDate();
				if(values.size() > 1){
					value = this.toDateList(values);
				}
			
			}else if(value instanceof String && ("true".equals(value) || "false".equals(value))){
				
				if("true".equals(value)){
					value = true;
				}else{
					value = false;
				}
			}
			
			
			else{
				//check to see if its a multi-value field
				if(values.size() > 1){
					value = this.toList(values);
				}
			}
			
			//write to the bean.
			
			if("".equals(value) || null == value){
				reflect.invokeSetter(prop.getWriteMethod(), bean, null);
			}else{
				reflect.invokeSetter(prop.getWriteMethod(), bean, value);
			}
		}
		
	} catch (Exception e) {
		logger.log(Level.SEVERE, "Uncaught exception", e);
	}

}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:48,代码来源:BeanBinder.java

示例6: buildResponse

import lotus.domino.DateTime; //导入方法依赖的package包/类
@Override
public String buildResponse(Map<?, ?> params, Session sesServer)
		throws NagiosException {
	StringBuilder sbResult = new StringBuilder();
	try {
		String strNagiosDB = NotesIniFactory.getNagiosDB();
		DateTime dtCurrent = sesServer.createDateTime(new Date());
		dtCurrent.adjustMinute(-5);
		Date dt5Min = dtCurrent.toJavaDate();
		dtCurrent.adjustMinute(-55);
		Date dt60min = dtCurrent.toJavaDate();
		if (strNagiosDB != null && !"".equals(strNagiosDB)) {
			if (ValueService.getInstance().getLastUpdated() == null) {
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			} else if (ValueService.getInstance().getLastUpdated()
					.before(dt60min)) {
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			}
		}
		if (StatisticService.getInstance().getLastUpdated() == null) {
			ActionRegistry.getInstance().getServletAction("readstats")
					.buildResponse(params, sesServer);
		} else if (StatisticService.getInstance().getLastUpdated()
				.before(dt5Min)) {
			ActionRegistry.getInstance().getServletAction("readstats")
					.buildResponse(params, sesServer);
		}
		List<String> lstKeys = StatisticService.getInstance().getStatKeys();
		for (String strKey : lstKeys) {
			StatisticEntry se = StatisticService.getInstance().getEntry(
					strKey);
			ValueService.getInstance().updateStatsEntry(se);
			sbResult.append(se.getKey() + ": " + se.getValue() + ": "
					+ se.getClearText() + " STATUS -> "
					+ se.getStatusInfo() + "\n");
		}
	} catch (Exception e) {
		throw new NagiosException("Error during ShowAllStatistic.buildValues()",e);
	}
	return sbResult.toString();
}
 
开发者ID:OpenNTF,项目名称:Nagios4DominoIntegration,代码行数:44,代码来源:ShowAllStatistic.java

示例7: buildResponse

import lotus.domino.DateTime; //导入方法依赖的package包/类
@Override
public String buildResponse(Map<?, ?> params, Session sesServer)
		throws NagiosException {
	String strRC = "";
	try {
		String strNagiosDB = NotesIniFactory.getNagiosDB();
		String[] arrStats = (String[]) params.get("stats");
		String strStats = "";
		if (arrStats == null) {
			throw new NagiosException("Missing stats parameter");
		}
		strStats = arrStats[0];
		if (strStats == null || "".equals(strStats)) {
			throw new NagiosException("Missing stats parameter");
		}			
		DateTime dtCurrent = sesServer.createDateTime(new Date());
		dtCurrent.adjustMinute(-5);
		Date dt5Min = dtCurrent.toJavaDate();
		dtCurrent.adjustMinute(-55);
		Date dt60min = dtCurrent.toJavaDate();
		if (strNagiosDB != null && !"".equals(strNagiosDB)) {
			if (ValueService.getInstance().getLastUpdated() == null) {
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			} else if (ValueService.getInstance().getLastUpdated()
					.before(dt60min)) {
				// WE read all 60min the Values
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			}
		}
		if (StatisticService.getInstance().getLastUpdated() == null) {
			ActionRegistry.getInstance().getServletAction("readstats")
					.buildResponse(params, sesServer);
		} else if (StatisticService.getInstance().getLastUpdated()
				.before(dt5Min)) {
			ActionRegistry.getInstance().getServletAction("readstats")
					.buildResponse(params, sesServer);
		}
		StatisticEntry se = StatisticService.getInstance().getEntry(
				strStats);
		if (se == null) {
			throw new NagiosException("No statistic value for " + strStats);
		}
		ValueService.getInstance().updateStatsEntry(se);
		strRC = se.getNAGIOSResponse();
	} catch (Exception e) {
		throw new NagiosException(
				"Error during ShowStatisticValue.buildValues()", e);
	}
	return strRC;
}
 
开发者ID:OpenNTF,项目名称:Nagios4DominoIntegration,代码行数:53,代码来源:ShowStatisticValue.java

示例8: buildResponse

import lotus.domino.DateTime; //导入方法依赖的package包/类
@Override
public String buildResponse(Map<?, ?> params, Session sesServer)
		throws NagiosException {
	String strRC = "";
	try {
		String strNagiosDB = NotesIniFactory.getNagiosDB();
		String[] arrProbeID = (String[]) params.get("id");
		String strProbeID = "";
		if (arrProbeID == null) {
			throw new NagiosException("Missing stats parameter");
		}
		strProbeID = arrProbeID[0];
		if (strProbeID == null || "".equals(strProbeID)) {
			throw new NagiosException("Missing stats parameter");
		}			
		DateTime dtCurrent = sesServer.createDateTime(new Date());
		dtCurrent.adjustMinute(-60);
		Date dt60min = dtCurrent.toJavaDate();
		if (strNagiosDB != null && !"".equals(strNagiosDB)) {
			if (ValueService.getInstance().getLastUpdated() == null) {
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			} else if (ValueService.getInstance().getLastUpdated()
					.before(dt60min)) {
				// WE read all 60min the Values
				ValueService.getInstance().loadValues(strNagiosDB,
						sesServer);
			}
		}
		StatisticEntry se = ReadDatabaseDocument.readDatabaseDocument(strProbeID, sesServer);
		if (se == null) {
			throw new NagiosException("No statistic value for " + strProbeID);
		}
		strRC = se.getNAGIOSDatabaseResponse();
		
	return strRC;	
		
	} catch (Exception e) {
		// TODO: handle exception
	}
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:OpenNTF,项目名称:Nagios4DominoIntegration,代码行数:44,代码来源:ShowStatisticValueFromDatabase.java


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