Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package net.ftlines.wicket.fullcalendar;
 
 import java.io.File;
 import java.io.Writer;
 
 
 class Json {
 	private Json() {
 
 	}
 
 	private static class MyJsonFactory extends MappingJsonFactory {
 		}
 
 			return super.createJsonGenerator(fenc).useDefaultPrettyPrinter();
 		}
 
 			return super.createJsonGenerator(outenc).useDefaultPrettyPrinter();
 		}
 	}
 
 	public static String toJson(Object object) {
 		ObjectMapper mapper = new ObjectMapper(new MyJsonFactory());
 		SimpleModule module = new SimpleModule("fullcalendar"new Version(1, 0, 0, null));
 		mapper.registerModule(module);
 
 		String json = null;
 		try {
 			json = mapper.writeValueAsString(object);
 		} catch (Exception e) {
 			throw new RuntimeException("Error encoding object: " + object + " into JSON string"e);
 		}
 		return json;
 	}
 
 	public static class DateTimeSerializer extends JsonSerializer<DateTime> {
 		public void serialize(DateTime valueJsonGenerator jgenSerializerProvider providerthrows IOException,
 			jgen.writeString(ISODateTimeFormat.dateTime().print(value));
 		}
 
 		public Class<DateTimehandledType() {
 			return DateTime.class;
 		}
 
 	}
 
 	public static class LocalTimeSerializer extends JsonSerializer<LocalTime> {
 		public void serialize(LocalTime valueJsonGenerator jgenSerializerProvider providerthrows IOException,
 			jgen.writeString(value.toString("h:mmaa"));
 		}
 
 		public Class<LocalTimehandledType() {
 			return LocalTime.class;
 		}
 
	}
	public static class Script implements Serializable {
		private String code;
		public Script(String value) {
			this. = value;
		}
		public String getDeclaration() {
			return ;
		}
	}
New to GrepCode? Check out our FAQ X