/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* 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.kie.workbench.common.stunner.svg.gen.translator;
import org.kie.workbench.common.stunner.svg.gen.exception.TranslatorException;
import org.w3c.dom.Element;
/**
* Translates a given SVG element into the view definition type.
* @param <E> The SVG element.
* @param <O> The SVG view definition.
*/
public interface SVGElementTranslator<E extends Element, O> extends Translator<E> {
/**
* The name for the tag that this translator is able to process.
*/
String getTagName();
/**
* Process the given input and generates the SVG view definition instance for it.
* @param input The source element.
* @param context The translator context.
*/
O translate(final E input,
final SVGTranslatorContext context) throws TranslatorException;
}