org.eclipse.persistence.internal.oxm.mappings.TransformationMapping Maven / Gradle / Ivy
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Blaise Doughan - 2.5 - initial implementation
package org.eclipse.persistence.internal.oxm.mappings;
import java.util.List;
import org.eclipse.persistence.core.descriptors.CoreDescriptor;
import org.eclipse.persistence.core.mappings.CoreAttributeAccessor;
import org.eclipse.persistence.internal.core.helper.CoreField;
import org.eclipse.persistence.internal.core.queries.CoreContainerPolicy;
import org.eclipse.persistence.internal.core.sessions.CoreAbstractSession;
import org.eclipse.persistence.internal.oxm.record.TransformationRecord;
import org.eclipse.persistence.internal.oxm.record.UnmarshalRecord;
import org.eclipse.persistence.internal.oxm.record.XMLRecord;
public interface TransformationMapping<
ABSTRACT_SESSION extends CoreAbstractSession,
ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,
CONTAINER_POLICY extends CoreContainerPolicy,
DESCRIPTOR extends CoreDescriptor,
FIELD extends CoreField,
TRANSFORMATION_RECORD extends TransformationRecord,
XML_RECORD extends XMLRecord> extends Mapping {
/**
* Add the name of field and the name of the method
* that returns the value to be placed in said field
* when the object is written to the database.
* The method may take zero arguments, or it may
* take a single argument of type
* org.eclipse.persistence.sessions.Session
.
*/
void addFieldTransformation(String fieldName, String methodName);
/**
* INTERNAL:
* Add the name of a field and the name of a class which implements
* the FieldTransformer interface. When the object is written, the transform
* method will be called on the FieldTransformer to acquire the value to put
* in the field.
*/
void addFieldTransformerClassName(String fieldName, String className);
/**
* INTERNAL:
* @return a vector which stores fields and their respective transformers.
*/
List