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

com.safelayer.rap.impl.resolvers.ValueMappingResolver Maven / Gradle / Ivy

Go to download

The PKI Connector RESTAPI is a library that helps developing new PKI Connectors for TrustedX

The newest version!
package com.safelayer.rap.impl.resolvers;

import java.util.List;

import com.safelayer.rap.api.model.issuance.RegistrationParameters;
import com.safelayer.rap.api.model.mapping.ByLabelsValueMapping;
import com.safelayer.rap.api.model.mapping.DynamicValueMapping;
import com.safelayer.rap.api.model.mapping.StaticValueMapping;
import com.safelayer.rap.api.model.mapping.ValueMapping;

public class ValueMappingResolver {

	private DynamicValueResolver templateResolver;
	private List labels;

	public ValueMappingResolver(RegistrationParameters params, List labels) {
		this.templateResolver = new DynamicValueResolver(params);
		this.labels = labels;
	}

	public String resolve(ValueMapping valueMapping) throws Exception {
		if (valueMapping instanceof StaticValueMapping)
			return ((StaticValueMapping) valueMapping).getValue();

		if (valueMapping instanceof DynamicValueMapping)
			return templateResolver.resolve(((DynamicValueMapping) valueMapping).getTemplate());

		ByLabelsValueResolver labelsResolver = new ByLabelsValueResolver((ByLabelsValueMapping) valueMapping);
		return labelsResolver.resolve(labels);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy