- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.exolab.castor.types.Year
类的一些代码示例,展示了Year
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Year
类的具体详情如下:
包路径:org.exolab.castor.types.Year
类名称:Year
[英]Describe an XML schema Year.
The date type is derived from time period by setting up the facet :
Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/ and was last in http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ and was removed by http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/. It was not in the final approved recommendation: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
[中]请描述一个XML模式。
日期类型是通过设置方面从时间段派生的:
*“P1Y”的持续时间
注:此数据类型不包含在任何建议中。它是在年引入的http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/是最后一个进来的http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/并被http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/.最终批准的建议中没有:http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
代码示例来源:origin: org.codehaus.castor/castor-xml
/**
* Creates a new instance of the object described by this field.
*
* @param parent The object for which the field is created
* @return A new instance of the field's value
* @throws IllegalStateException This field is a simple type and cannot be instantiated
*/
public Object newInstance(Object parent) throws IllegalStateException {
return new Year();
} // -- newInstance
代码示例来源:origin: org.codehaus.castor/castor-xml
/**
* parse a String and convert it into a java.lang.Object
*
* @param str the string to parse
* @return the java.lang.Object represented by the string
* @throws ParseException a parse exception is thrown if the string to parse does not follow the
* rigth format (see the description of this class)
*/
public static Object parse(String str) throws ParseException {
return parseYear(str);
}
代码示例来源:origin: org.codehaus.castor/castor-xml
public java.util.Date toDate() throws ParseException {
java.util.Date date = null;
SimpleDateFormat df = new SimpleDateFormat(YEAR_FORMAT);
SimpleTimeZone timeZone = new SimpleTimeZone(0, "UTC");
// Set the time zone
if (!isUTC()) {
int offset = 0;
offset = ((this.getZoneMinute() + this.getZoneHour() * 60) * 60 * 1000);
offset = isZoneNegative() ? -offset : offset;
timeZone.setRawOffset(offset);
timeZone.setID(TimeZone.getAvailableIDs(offset)[0]);
}
df.setTimeZone(timeZone);
date = df.parse(this.toString());
return date;
}// toDate()
代码示例来源:origin: org.codehaus.castor/castor-xml
/**
* Sets the value of the field associated with this descriptor.
*
* @param target the object in which to set the value
* @param value the value of the field
*/
public void setValue(Object target, Object value) throws java.lang.IllegalStateException {
if (!(target instanceof Year)) {
// -- throw exception
}
Year yearTarget = (Year) target;
if (value == null) {
/// do something
}
// -- update current instance of time with new year
try {
Year temp = Year.parseYear(value.toString());
yearTarget.setCentury(temp.getCentury());
yearTarget.setYear(temp.getYear());
} catch (Exception ex) {
// -- ignore for now
}
} // -- setValue
代码示例来源:origin: org.codehaus.castor/castor-xml
Year result = new Year();
result.setNegative();
str = str.substring(1);
System.out.println("In parsing method of Year");
System.out.println("String to parse : " + str);
System.out.println("Negative ? " + result.isNegative());
System.out.println("Processing century: " + str.substring(0, 2));
result.setCentury(Short.parseShort(str.substring(0, 2)));
if (DEBUG) {
System.out.println("Processing year: " + str.substring(2, 4));
result.setYear(Short.parseShort(str.substring(2, 4)));
} catch (UnsupportedOperationException e) {
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
/**
* convert this Year to a string
* The format is defined by W3C XML Schema draft and ISO8601
* i.e (+|-)CCYY
* @return a string representing this Month
*/
public String toString() {
StringBuffer result = new StringBuffer();
result.append(this.getCentury());
if (result.length() == 1)
result.insert(0,0);
if ((this.getYear()/10) == 0)
result.append(0);
result.append(this.getYear());
if (isNegative())
result.insert(0,'-');
return result.toString();
}//toString
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
public java.util.Date toDate() throws ParseException {
java.util.Date date = null;
SimpleDateFormat df = new SimpleDateFormat(YEAR_FORMAT);
SimpleTimeZone timeZone = new SimpleTimeZone(0,"UTC");
// Set the time zone
if ( !isUTC() ) {
int offset = 0;
offset = ( (this.getZoneMinute() + this.getZoneHour()*60)*60*1000);
offset = isZoneNegative() ? -offset : offset;
timeZone.setRawOffset(offset);
timeZone.setID(TimeZone.getAvailableIDs(offset)[0]);
}
df.setTimeZone(timeZone);
date = df.parse(this.toString());
return date;
}//toDate()
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
/**
* Sets the value of the field associated with this descriptor.
*
* @param target
* the object in which to set the value
* @param value
* the value of the field
*/
public void setValue(Object target, Object value) throws java.lang.IllegalStateException {
if (! (target instanceof Year) ) {
//-- throw exception
}
Year yearTarget = (Year) target;
if (value == null) {
/// do something
}
//-- update current instance of time with new year
try {
Year temp = Year.parseYear(value.toString()) ;
yearTarget.setCentury(temp.getCentury());
yearTarget.setYear(temp.getYear());
} catch (Exception ex) {
//-- ignore for now
}
} //-- setValue
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
Year result = new Year();
result.setNegative();
str =str.substring(1);
System.out.println("In parsing method of Year");
System.out.println("String to parse : "+str);
System.out.println("Negative ? "+result.isNegative());
System.out.println("Processing century: "+str.substring(0,2));
result.setCentury(Short.parseShort( str.substring(0,2) ));
if (DEBUG) {
System.out.println("Processing year: "+str.substring(2,4));
result.setYear(Short.parseShort( str.substring(2,4) ));
} catch(UnsupportedOperationException e) {
代码示例来源:origin: org.codehaus.castor/castor-xml
/**
* convert this Year to a string The format is defined by W3C XML Schema draft and ISO8601 i.e
* (+|-)CCYY
*
* @return a string representing this Month
*/
public String toString() {
StringBuilder result = new StringBuilder();
result.append(this.getCentury());
if (result.length() == 1)
result.insert(0, 0);
if ((this.getYear() / 10) == 0)
result.append(0);
result.append(this.getYear());
if (isNegative())
result.insert(0, '-');
return result.toString();
}// toString
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
/**
* parse a String and convert it into a java.lang.Object
* @param str the string to parse
* @return the java.lang.Object represented by the string
* @throws ParseException a parse exception is thrown if the string to parse
* does not follow the rigth format (see the description
* of this class)
*/
public static Object parse(String str) throws ParseException {
return parseYear(str);
}
代码示例来源:origin: org.codehaus.castor/com.springsource.org.castor
/**
* Creates a new instance of the object described by this field.
*
* @param parent
* The object for which the field is created
* @return A new instance of the field's value
* @throws IllegalStateException
* This field is a simple type and cannot be instantiated
*/
public Object newInstance(Object parent) throws IllegalStateException {
return new Year();
} //-- newInstance
本文整理了Java中org.exolab.castor.xml.XMLException类的一些代码示例,展示了XMLException类的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中org.exolab.castor.types.Year类的一些代码示例,展示了Year类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平
编组和解组JAXB或org.exolab.castor.xml哪个更好 这两种方法中哪一种是更好的方法,为什么? 最佳答案 为什么使用JAXB: 它来自javax,并且比Castor具有更多的社区支持
本文整理了Java中org.exolab.castor.xml.XMLException.()方法的一些代码示例,展示了XMLException.()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.exolab.castor.xml.XMLException.getMessage()方法的一些代码示例,展示了XMLException.getMessage()的具体用法
本文整理了Java中org.exolab.castor.types.Year.isUTC()方法的一些代码示例,展示了Year.isUTC()的具体用法。这些代码示例主要来源于Github/Stack
本文整理了Java中org.exolab.castor.types.Year.toString()方法的一些代码示例,展示了Year.toString()的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.exolab.castor.types.Year.getYear()方法的一些代码示例,展示了Year.getYear()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.exolab.castor.types.Year.setYear()方法的一些代码示例,展示了Year.setYear()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.exolab.castor.types.Year.setZone()方法的一些代码示例,展示了Year.setZone()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.exolab.castor.types.Year.setNegative()方法的一些代码示例,展示了Year.setNegative()的具体用法。这些代码示例主要来源于
本文整理了Java中org.exolab.castor.types.Year.isNegative()方法的一些代码示例,展示了Year.isNegative()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.exolab.castor.types.Year.getZoneMinute()方法的一些代码示例,展示了Year.getZoneMinute()的具体用法。这些代码示例主
本文整理了Java中org.exolab.castor.types.Year.parseYear()方法的一些代码示例,展示了Year.parseYear()的具体用法。这些代码示例主要来源于Gith
本文整理了Java中org.exolab.castor.xml.util.XMLFieldDescriptorImpl.matches()方法的一些代码示例,展示了XMLFieldDescriptor
本文整理了Java中org.exolab.castor.xml.util.XMLFieldDescriptorImpl.getQNamePrefix()方法的一些代码示例,展示了XMLFieldDes
我是一名优秀的程序员,十分优秀!