@@ -0,0 +1,2100 @@
+/*%0A * Copyright 2018 MovingBlocks%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.terasology.persistence.typeHandling;%0A%0Aimport org.terasology.reflection.TypeInfo;%0A%0A/**%0A * Represents the context in which a %7B@link TypeHandlerFactory%7D creates %7B@link TypeHandler%7D instances.%0A * %3Cp%3E%0A * The %7B@link TypeHandlerFactoryContext%7D is used to look up %7B@link TypeHandler%7D instances and load classes%0A * while staying within the sandbox rules if called from a module.%0A */%0Apublic class TypeHandlerFactoryContext %7B%0A    private TypeSerializationLibrary typeSerializationLibrary;%0A    private ClassLoader contextClassLoader;%0A%0A    public TypeHandlerFactoryContext(TypeSerializationLibrary typeSerializationLibrary, ClassLoader contextClassLoader) %7B%0A        this.typeSerializationLibrary = typeSerializationLibrary;%0A        this.contextClassLoader = contextClassLoader;%0A    %7D%0A%0A    /**%0A     * Returns the %7B@link TypeSerializationLibrary%7D that called the %7B@link TypeHandlerFactory#create(TypeInfo, TypeSerializationLibrary)%7D method.%0A     */%0A    public TypeSerializationLibrary getTypeSerializationLibrary() %7B%0A        return typeSerializationLibrary;%0A    %7D%0A%0A    /**%0A     * Returns the %7B@link ClassLoader%7D to use to load classes in the%0A     * %7B@link TypeHandlerFactory#create(TypeInfo, TypeSerializationLibrary)%7D method.%0A     * %3Cp%3E%0A     * If classes are loaded manually using a method like %7B@link Class#forName(String)%7D, this%0A     * %7B@link ClassLoader%7D must be used so that modules remain sandboxed.%0A     */%0A    public ClassLoader getContextClassLoader() %7B%0A        return contextClassLoader;%0A    %7D%0A%7D%0A

Add TypeHandlerFactoryContext