- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.eclipse.persistence.internal.oxm.XMLConversionManager.getTimeZone()
方法的一些代码示例,展示了XMLConversionManager.getTimeZone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLConversionManager.getTimeZone()
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.oxm.XMLConversionManager
类名称:XMLConversionManager
方法名:getTimeZone
[英]Return the specified TimeZone used for all String to date object conversions.
[中]返回用于所有字符串到日期对象转换的指定时区。
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private String appendTimeZone(String string, Date date) {
StringBuilder stringBuilder = new StringBuilder(string);
// GMT Time Zone
int rawMinuteOffset = getTimeZone().getOffset(date.getTime()) / 60000;
if (0 == rawMinuteOffset) {
stringBuilder.append(GMT_SUFFIX);
return stringBuilder.toString();
}
// +HH:MM
if (rawMinuteOffset < 0) {
stringBuilder.append('-');
rawMinuteOffset = Math.abs(rawMinuteOffset);
} else {
stringBuilder.append('+');
}
int hourOffset = rawMinuteOffset / 60;
if (hourOffset < 10) {
stringBuilder.append('0');
}
stringBuilder.append(hourOffset);
stringBuilder.append(Constants.COLON);
int minuteOffset = rawMinuteOffset % 60;
if (minuteOffset < 10) {
stringBuilder.append('0');
}
stringBuilder.append(minuteOffset);
return stringBuilder.toString();
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public Calendar convertStringToCalendar(String sourceString, QName schemaTypeQName) {
java.util.Date date = convertStringToDate(sourceString, schemaTypeQName);
Calendar cal = Helper.calendarFromUtilDate(date);
cal.setTimeZone(getTimeZone());
return cal;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
int rawMinuteOffset = getTimeZone().getRawOffset() / 60000;
if (0 == rawMinuteOffset) {
stringBuilder.append(GMT_SUFFIX);
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private String appendTimeZone(String string, Date date) {
StringBuilder stringBuilder = new StringBuilder(string);
// GMT Time Zone
int rawMinuteOffset = getTimeZone().getOffset(date.getTime()) / 60000;
if (0 == rawMinuteOffset) {
stringBuilder.append(GMT_SUFFIX);
return stringBuilder.toString();
}
// +HH:MM
if (rawMinuteOffset < 0) {
stringBuilder.append('-');
rawMinuteOffset = Math.abs(rawMinuteOffset);
} else {
stringBuilder.append('+');
}
int hourOffset = rawMinuteOffset / 60;
if (hourOffset < 10) {
stringBuilder.append('0');
}
stringBuilder.append(hourOffset);
stringBuilder.append(Constants.COLON);
int minuteOffset = rawMinuteOffset % 60;
if (minuteOffset < 10) {
stringBuilder.append('0');
}
stringBuilder.append(minuteOffset);
return stringBuilder.toString();
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private String stringFromSQLTime(Time sourceTime) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
Calendar cal = Calendar.getInstance(getTimeZone());
cal.setTime(sourceTime);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
String string= xgc.toXMLFormat();
string = appendMillis(string, sourceTime.getTime());
return appendTimeZone(string, sourceTime);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* This method returns a dateTime string representing a given
* java.util.Date.
*
* BC dates (sourceDate.getTime() < YEAR_ONE_AD_TIME) are handled
* as follows: '2007 BC' --> '-2006 AD'
*
* @param sourceDate
* @return
*/
private String stringFromDate(java.util.Date sourceDate) {
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setTime(sourceDate);
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar(cal);
String string = xgc.toXMLFormat();
string = truncateMillis(string);
return string;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private String stringFromSQLDate(java.sql.Date sourceDate) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
Calendar cal = Calendar.getInstance(getTimeZone());
cal.setTime(sourceDate);
if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
xgc.setYear(-cal.get(Calendar.YEAR));
}else{
xgc.setYear(cal.get(Calendar.YEAR));
}
xgc.setMonth(cal.get(Calendar.MONTH)+1);
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
return xgc.toXMLFormat();
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private String stringFromSQLTime(Time sourceTime) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setGregorianChange(new Date(Long.MIN_VALUE));
cal.setTime(sourceTime);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
String string= xgc.toXMLFormat();
string = appendMillis(string, sourceTime.getTime());
return appendTimeZone(string, sourceTime);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public java.util.Date convertStringToDate(String sourceString, QName schemaType) {
XMLGregorianCalendar xmlGregorianCalender = convertStringToXMLGregorianCalendar(sourceString, schemaType);
if (schemaType == null) {
schemaType = xmlGregorianCalender.getXMLSchemaType();
}
XMLGregorianCalendar defaults = getDatatypeFactory().newXMLGregorianCalendar();
defaults.setTimezone(getTimeZone().getRawOffset()/60000);
GregorianCalendar cal;
if(xmlGregorianCalender.getTimezone() == DatatypeConstants.FIELD_UNDEFINED){
cal = xmlGregorianCalender.toGregorianCalendar(getTimeZone(), null, null);
}else{
cal = xmlGregorianCalender.toGregorianCalendar();
}
cal.setGregorianChange(new Date(Long.MAX_VALUE));
Date returnDate= cal.getTime();
return returnDate;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
private String stringFromSQLTime(Time sourceTime) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setGregorianChange(new Date(Long.MIN_VALUE));
cal.setTime(sourceTime);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
String string= xgc.toXMLFormat();
return appendTimeZone(string);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
private String stringFromSQLDate(java.sql.Date sourceDate) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setGregorianChange(new Date(Long.MIN_VALUE));
cal.setTime(sourceDate);
if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
xgc.setYear(-cal.get(Calendar.YEAR));
}else{
xgc.setYear(cal.get(Calendar.YEAR));
}
xgc.setMonth(cal.get(Calendar.MONTH)+1);
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
return xgc.toXMLFormat();
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private String stringFromSQLDate(java.sql.Date sourceDate) {
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setGregorianChange(new Date(Long.MIN_VALUE));
cal.setTime(sourceDate);
if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
xgc.setYear(-cal.get(Calendar.YEAR));
}else{
xgc.setYear(cal.get(Calendar.YEAR));
}
xgc.setMonth(cal.get(Calendar.MONTH)+1);
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
return xgc.toXMLFormat();
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* This method returns a dateTime string representing a given
* java.util.Date.
*
* BC dates (sourceDate.getTime() < YEAR_ONE_AD_TIME) are handled
* as follows: '2007 BC' --> '-2006 AD'
*
* @param sourceDate
* @return
*/
private String stringFromDate(java.util.Date sourceDate) {
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setTime(sourceDate);
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar(cal);
String string = xgc.toXMLFormat();
string = truncateMillis(string);
return string;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Convert from a Date to a String representation of the MonthDay type.
*
* @param date the date to convert
* @return a Date to a String representation of the MonthDay type.
*/
public String toMonthDay(Date date) {
if (null == date) {
return null;
}
GregorianCalendar dateCalendar = new GregorianCalendar(getXMLConversionManager().getTimeZone());
dateCalendar.clear();
dateCalendar.setTime(date);
dateCalendar.clear(Calendar.ZONE_OFFSET);
return toMonthDay(dateCalendar);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo
/**
* Creates a Calendar based on a given Duration and Locale.
*
* @param dur the Duration object to use to populate the Calendar
* @param loc the Locale to use - null is a valid value
*
* @return a Calendar
*/
private Calendar toCalendar(Duration dur, Locale loc) {
Calendar cal;
if (loc == null) {
cal = Calendar.getInstance(getXMLConversionManager().getTimeZone());
} else {
cal = Calendar.getInstance(getXMLConversionManager().getTimeZone(), loc);
}
cal.setTimeInMillis(dur.getTimeInMillis(cal));
cal.set(Calendar.YEAR, dur.getYears());
cal.set(Calendar.MONTH, dur.getMonths() - 1);
cal.set(Calendar.DATE, dur.getDays());
cal.set(Calendar.HOUR_OF_DAY, dur.getHours());
cal.set(Calendar.MINUTE, dur.getMinutes());
cal.set(Calendar.SECOND, dur.getSeconds());
return cal;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo
/**
* Convert from a Date to a String representation of the MonthDay type.
*
* @param date the date to convert
* @return a Date to a String representation of the MonthDay type.
*/
public String toMonthDay(Date date) {
if (null == date) {
return null;
}
GregorianCalendar dateCalendar = new GregorianCalendar(getXMLConversionManager().getTimeZone());
dateCalendar.clear();
dateCalendar.setTime(date);
dateCalendar.clear(Calendar.ZONE_OFFSET);
return toMonthDay(dateCalendar);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Creates a Calendar based on a given Duration and Locale.
*
* @param dur the Duration object to use to populate the Calendar
* @param loc the Locale to use - null is a valid value
*
* @return a Calendar
*/
private Calendar toCalendar(Duration dur, Locale loc) {
Calendar cal;
if (loc == null) {
cal = Calendar.getInstance(getXMLConversionManager().getTimeZone());
} else {
cal = Calendar.getInstance(getXMLConversionManager().getTimeZone(), loc);
}
cal.setTimeInMillis(dur.getTimeInMillis(cal));
cal.set(Calendar.YEAR, dur.getYears());
cal.set(Calendar.MONTH, dur.getMonths() - 1);
cal.set(Calendar.DATE, dur.getDays());
cal.set(Calendar.HOUR_OF_DAY, dur.getHours());
cal.set(Calendar.MINUTE, dur.getMinutes());
cal.set(Calendar.SECOND, dur.getSeconds());
return cal;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* This method returns a dateTime string representing a given
* Timestamp.
*
* BC dates (sourceDate.getTime() < YEAR_ONE_AD_TIME) are handled
* as follows: '2007 BC' --> '-2006 AD'
*
* @param sourceDate
* @return
*/
private String stringFromTimestamp(Timestamp sourceDate) {
Calendar cal = Calendar.getInstance(getTimeZone());
cal.setTime(sourceDate);
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
if(cal.get(Calendar.ERA)== GregorianCalendar.BC){
xgc.setYear(-cal.get(Calendar.YEAR));
}else{
xgc.setYear(cal.get(Calendar.YEAR));
}
xgc.setMonth(cal.get(Calendar.MONTH)+1);
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
String string= xgc.toXMLFormat();
string = appendNanos(string, sourceDate);
return appendTimeZone(string, sourceDate);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* This method returns a dateTime string representing a given
* Timestamp.
*
* BC dates (sourceDate.getTime() < YEAR_ONE_AD_TIME) are handled
* as follows: '2007 BC' --> '-2006 AD'
*
* @param sourceDate
* @return
*/
private String stringFromTimestamp(Timestamp sourceDate) {
GregorianCalendar cal = new GregorianCalendar(getTimeZone());
cal.setGregorianChange(new Date(Long.MIN_VALUE));
cal.setTime(sourceDate);
XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
if(cal.get(Calendar.ERA)== GregorianCalendar.BC){
xgc.setYear(-cal.get(Calendar.YEAR));
}else{
xgc.setYear(cal.get(Calendar.YEAR));
}
xgc.setMonth(cal.get(Calendar.MONTH)+1);
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
String string= xgc.toXMLFormat();
string = appendNanos(string, sourceDate);
return appendTimeZone(string);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo
Calendar cal;
if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
cal = xgc.toGregorianCalendar(getXMLConversionManager().getTimeZone(), locale, null);
cal.clear(Calendar.ZONE_OFFSET);
} else {
这个问题在这里已经有了答案: How to make a property protected AND internal in C#? (8 个答案) 关闭 9 年前。 我需要声明一个既受又 内部保
我对在 Kotlin 1.3 中使用 Strings.isNullOrEmpty 导入 jdk.internal.joptsimple.internal.Strings.isNullOrEmpty 的
我有一个项目,实习生单元测试应该位于与被测源代码不同的目录树中。有点像这样: projectRoot projectRoot/src projectRoot/tests projectRoot/tes
如何在功能测试中访问浏览器的主要 JavaScript 范围?例如,我想获取对 Dojo 小部件的引用并检查它的属性。例如,在浏览器 JavaScript 控制台中,我可以运行: dijit.
public class TestClass { protected internal int FieldA; internal protected int FieldB; }
我想创建一个内部自动属性: internal bool IP { get; protected internal set; } 我认为可以使 setter protected 或 protected
java.lang.NoSuchMethodError: okhttp3.internal.Internal.initializeInstanceForTests() When creating a
我正在尝试使用 intern 来测试在 node.js 下运行的 dojo 应用程序 我的 intern.js 配置文件是这样的: define({ loader: {
我在 Raspbian wheezy 上的 nginx 1.2.1-2.2 有点问题。我认为它是在我更改站点可用/默认文件中的索引后开始的。以下是相关文件: nginx.conf user www-d
我在尝试加载 Visual studio 2012 时遇到了此错误,遇到了异常。这可能是由扩展引起的,并且在 C:\Users\~\AppData 中给出了附加信息的位置\Roaming\Micros
我正在将一个项目迁移到 Java9,在我切换到新的 Java 版本后,测试开始失败,看起来 PowerMock 正在尝试访问一些它无法访问的类。 Tests run: 1, Failures: 0,
该触发器用于检测进度中的顺序是否已更新,并有助于更新进度的概览状态和完成时间。 但是当发生内部错误时,它并不总是有效,如下所示: Error: 13 INTERNAL: An internal err
当我尝试将包含一些 JavaScript 的项目导入工作区时(使用 Eclipse 的 Neon.M6 版本),出现此错误: eclipse.buildId=4.6.0.I20160317-0200
我在尝试访问 FullContact API 服务器时收到此错误。我正在使用 okhttp 2.7.5 和 okhttp-urlconnection 2.7.5 以及改造 1.9.0。 Caused
当我试图读取一个以前版本的 pandas 保存的 pickle 文件时,它产生了一个 ImportError。 ImportError: No module named 'pandas.core.in
我正在将一个项目迁移到 Java9,在我切换到新的 Java 版本后测试开始失败,似乎 PowerMock 正在尝试访问它无法访问的一些类。 Tests run: 1, Failures: 0, Er
我正在尝试设置 Lumen - 建立在 Laravel 组件之上的“微框架”。服务器端有 nginx + php-fpm。 这是我的 nginx 配置: server { server_nam
在我们的项目中,我们决定在我们的项目中使用最新的 fmt 版本 (6.2.0) 并主要使用 printf 功能,因为我们在广泛使用 printf 的地方进行日志记录。 我使用 fmt 包中包含的 CM
我正在使用 Mockito jar 为 Groovy 编写 Junit 测试用例,但它给了我以下异常: java.lang.NoSuchMethodError: org.mockito.interna
我们的应用程序使用 Google 集合中的 MapMaker 类,并且我们遇到了以下异常,但仅限于使用 webstart 的 OS X 10.4。从应用程序包启动时以及在 OS X 10.5 和 Wi
我是一名优秀的程序员,十分优秀!