// Path: src/main/java/org/spearal/impl/ExtendedSpearalDecoder.java
// public interface ExtendedSpearalDecoder extends SpearalDecoder {
// 
// 	Object readAny(int parameterizedType) throws IOException;
// 	Object readAny(int parameterizedType, Type targetType) throws IOException;
// 	void skipAny(int parameterizedType) throws IOException;
// 	
// 	SpearalDateTime readDateTime(int parameterizedType) throws IOException;
// 	
// 	long readIntegral(int parameterizedType) throws IOException;
// 	
// 	BigInteger readBigIntegral(int parameterizedType) throws IOException;
// 	
// 	double readFloating(int parameterizedType) throws IOException;
// 	
// 	BigDecimal readBigFloating(int parameterizedType) throws IOException;
// 
// 	String readString(int parameterizedType) throws IOException;
// 	
// 	byte[] readByteArray(int parameterizedType) throws IOException;
// 	
// 	Object readCollection(int parameterizedType, Type targetType) throws IOException;
// 	void readCollection(int parameterizedType, Object holder, Property property)
// 		throws IOException, InstantiationException, IllegalAccessException, InvocationTargetException;
// 
// 	Map<?, ?> readMap(int parameterizedType, Type targetType) throws IOException;
// 	void readMap(int parameterizedType, Object holder, Property property)
// 		throws IOException, InstantiationException, IllegalAccessException, InvocationTargetException;
// 	
// 	Enum<?> readEnum(int parameterizedType, Type targetType) throws IOException;
// 
// 	Class<?> readClass(int parameterizedType, Type targetType) throws IOException;
// 	
// 	Object readBean(int parameterizedType, Type targetType) throws IOException;
// }
// 
// Path: src/main/java/org/spearal/impl/ExtendedSpearalEncoder.java
// public interface ExtendedSpearalEncoder extends SpearalEncoder {
// 	
// 	void writeNull() throws IOException;
// 	
// 	void writeBoolean(boolean value) throws IOException;
// 
// 	void writeDateTime(SpearalDateTime value) throws IOException;
// 
// 	void writeByte(byte value) throws IOException;
// 	void writeShort(short value) throws IOException;
// 	void writeInt(int value) throws IOException;
// 	void writeLong(long value) throws IOException;
// 	void writeBigInteger(BigInteger value) throws IOException;
// 
// 	void writeFloat(float value) throws IOException;
// 	void writeDouble(double value) throws IOException;
// 	void writeBigDecimal(BigDecimal value) throws IOException;
// 
// 	void writeChar(char value) throws IOException;
// 	void writeString(String value) throws IOException;
// 	
// 	void writeByteArray(byte[] value) throws IOException;
// 	void writeArray(Object value) throws IOException;
// 	
// 	void writeCollection(Collection<?> value) throws IOException;
// 	void writeMap(Map<?, ?> value) throws IOException;
// 	
// 	void writeEnum(Enum<?> value) throws IOException;
// 	void writeClass(Class<?> value) throws IOException;
// 	void writeBean(Object value) throws IOException;
// }


import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import org.spearal.impl.ExtendedSpearalDecoder;
import org.spearal.impl.ExtendedSpearalEncoder;
/**
 * == @Spearal ==>
 * 
 * Copyright (C) 2014 Franck WOLFF & William DRAI (http://www.spearal.io)
 *
 * 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 org.spearal.configuration;



/**
 * @author Franck WOLFF
 */
public interface PropertyFactory extends Repeatable {
	
	public static final Property[] ZERO_PROPERTIES = new Property[0];
	
	public interface Property {
		
		String getName();
		Class<?> getType();
		Type getGenericType();
		
		boolean hasField();
		Field getField();
		boolean hasGetter();
		Method getGetter();
		boolean hasSetter();
		Method getSetter();
		
		Class<?> getDeclaringClass();
		
		Object init(ExtendedSpearalDecoder decoder, Object holder)
			throws InstantiationException, IllegalAccessException, InvocationTargetException;
		
		Object get(Object holder)
			throws IllegalAccessException, InvocationTargetException;
		
		void set(Object holder, Object value)
			throws IllegalAccessException, InvocationTargetException;
		
		boolean isAnnotationPresent(Class<? extends Annotation> annotationClass);
		<A extends Annotation> A getAnnotation(Class<A> annotationClass);
		
		boolean isReadOnly();
		
		public void write(ExtendedSpearalEncoder encoder, Object holder)
			throws IOException, IllegalAccessException, InvocationTargetException;
			
// Path: src/main/java/org/spearal/impl/ExtendedSpearalDecoder.java
// public interface ExtendedSpearalDecoder extends SpearalDecoder {
// 
// 	Object readAny(int parameterizedType) throws IOException;
// 	Object readAny(int parameterizedType, Type targetType) throws IOException;
// 	void skipAny(int parameterizedType) throws IOException;
// 	
// 	SpearalDateTime readDateTime(int parameterizedType) throws IOException;
// 	
// 	long readIntegral(int parameterizedType) throws IOException;
// 	
// 	BigInteger readBigIntegral(int parameterizedType) throws IOException;
// 	
// 	double readFloating(int parameterizedType) throws IOException;
// 	
// 	BigDecimal readBigFloating(int parameterizedType) throws IOException;
// 
// 	String readString(int parameterizedType) throws IOException;
// 	
// 	byte[] readByteArray(int parameterizedType) throws IOException;
// 	
// 	Object readCollection(int parameterizedType, Type targetType) throws IOException;
// 	void readCollection(int parameterizedType, Object holder, Property property)
// 		throws IOException, InstantiationException, IllegalAccessException, InvocationTargetException;
// 
// 	Map<?, ?> readMap(int parameterizedType, Type targetType) throws IOException;
// 	void readMap(int parameterizedType, Object holder, Property property)
// 		throws IOException, InstantiationException, IllegalAccessException, InvocationTargetException;
// 	
// 	Enum<?> readEnum(int parameterizedType, Type targetType) throws IOException;
// 
// 	Class<?> readClass(int parameterizedType, Type targetType) throws IOException;
// 	
// 	Object readBean(int parameterizedType, Type targetType) throws IOException;
// }
// 
// Path: src/main/java/org/spearal/impl/ExtendedSpearalEncoder.java
// public interface ExtendedSpearalEncoder extends SpearalEncoder {
// 	
// 	void writeNull() throws IOException;
// 	
// 	void writeBoolean(boolean value) throws IOException;
// 
// 	void writeDateTime(SpearalDateTime value) throws IOException;
// 
// 	void writeByte(byte value) throws IOException;
// 	void writeShort(short value) throws IOException;
// 	void writeInt(int value) throws IOException;
// 	void writeLong(long value) throws IOException;
// 	void writeBigInteger(BigInteger value) throws IOException;
// 
// 	void writeFloat(float value) throws IOException;
// 	void writeDouble(double value) throws IOException;
// 	void writeBigDecimal(BigDecimal value) throws IOException;
// 
// 	void writeChar(char value) throws IOException;
// 	void writeString(String value) throws IOException;
// 	
// 	void writeByteArray(byte[] value) throws IOException;
// 	void writeArray(Object value) throws IOException;
// 	
// 	void writeCollection(Collection<?> value) throws IOException;
// 	void writeMap(Map<?, ?> value) throws IOException;
// 	
// 	void writeEnum(Enum<?> value) throws IOException;
// 	void writeClass(Class<?> value) throws IOException;
// 	void writeBean(Object value) throws IOException;
// }


// Path: src/main/java/org/spearal/configuration/PropertyFactory.java
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import org.spearal.impl.ExtendedSpearalDecoder;
import org.spearal.impl.ExtendedSpearalEncoder;

/**
 * == @Spearal ==>
 * 
 * Copyright (C) 2014 Franck WOLFF & William DRAI (http://www.spearal.io)
 *
 * 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 org.spearal.configuration;



/**
 * @author Franck WOLFF
 */
public interface PropertyFactory extends Repeatable {
	
	public static final Property[] ZERO_PROPERTIES = new Property[0];
	
	public interface Property {
		
		String getName();
		Class<?> getType();
		Type getGenericType();
		
		boolean hasField();
		Field getField();
		boolean hasGetter();
		Method getGetter();
		boolean hasSetter();
		Method getSetter();
		
		Class<?> getDeclaringClass();
		
		Object init(ExtendedSpearalDecoder decoder, Object holder)
			throws InstantiationException, IllegalAccessException, InvocationTargetException;
		
		Object get(Object holder)
			throws IllegalAccessException, InvocationTargetException;
		
		void set(Object holder, Object value)
			throws IllegalAccessException, InvocationTargetException;
		
		boolean isAnnotationPresent(Class<? extends Annotation> annotationClass);
		<A extends Annotation> A getAnnotation(Class<A> annotationClass);
		
		boolean isReadOnly();
		
		public void write(ExtendedSpearalEncoder encoder, Object holder)
			throws IOException, IllegalAccessException, InvocationTargetException;
			
		public void read(ExtendedSpearalDecoder decoder, Object holder, int parameterizedType)