Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sf.juffrou.xml.serializer;
 
 import java.util.Date;
 
public class DateSerializer implements Serializer {
	//ISO8601 long RFC822 zone
	private final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());
	public void serialize(JuffrouWriter writerBeanWrapper valueOwnerString valuePropertyName) {
		writer.write(.format((Date)valueOwner.getValue(valuePropertyName)));
	}
	public void deserialize(JuffrouReader readerBeanWrapper valueOwnerString valuePropertyName) {
		String value = reader.getText();
		try {
			valueOwner.setValue(valuePropertyName.parse(value));
catch (ParseException e) {
		}
	}
New to GrepCode? Check out our FAQ X