All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.appng.api.ResultService Maven / Gradle / Ivy

There is a newer version: 1.24.5
Show newest version
/*
 * Copyright 2011-2021 the original author or authors.
 *
 * 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.appng.api;

import java.sql.ResultSet;
import java.util.Collection;

import org.appng.xml.platform.Datafield;
import org.appng.xml.platform.FieldDef;
import org.appng.xml.platform.MetaData;
import org.appng.xml.platform.Result;
import org.appng.xml.platform.Resultset;
import org.springframework.data.domain.Page;

/**
 * Provides methods to transform a bindobject to a {@link Result} and a {@link Page} of bindobjects to a
 * {@link Resultset}.
 * 
 * @author Matthias Müller
 */
public interface ResultService {

	/**
	 * Builds a {@link ResultSet} from the items provided by the {@link Page}, using the {@link FieldProcessor}'s
	 * {@link MetaData}.
	 * 
	 * @param fp
	 *             a {@link FieldProcessor}
	 * @param page
	 *             a {@link Page} of bindobjects
	 * 
	 * @return a {@link Resultset} containing a {@link Result} for each item of the {@link Page}. Every {@link Result}
	 *         contains a {@link Datafield} for each {@link FieldDef} provided by the {@link FieldProcessor}'s
	 *         {@link MetaData}.
	 */
	Resultset getResultset(FieldProcessor fp, Page page);

	/**
	 * Builds a {@link ResultSet} from the items provided by the {@link Collection}, using the {@link FieldProcessor}'s
	 * {@link MetaData}.
* Note that pagination will not be available. * * @param fp * a {@link FieldProcessor} * @param items * a {@link Collection} of bindobjects * * @return a {@link Resultset} containing a {@link Result} for each item of the {@link Collection}. Every * {@link Result} contains a {@link Datafield} for each {@link FieldDef} provided by the * {@link FieldProcessor}'s {@link MetaData}. */ Resultset getResultset(FieldProcessor fp, Collection items); /** * Builds a {@link Result} from the provided bindObject, using the {@link FieldProcessor}'s {@link MetaData}. * * @param fp * a {@link FieldProcessor} * @param bindObject * a bindobject * * @return a {@link Result} containing a {@link Datafield} for each {@link FieldDef} provided by the * {@link FieldProcessor}'s {@link MetaData}. */ Result getResult(FieldProcessor fp, Object bindObject); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy