org.zodiac.template.base.impl.TemplateServiceDefinitionParser Maven / Gradle / Ivy
The newest version!
package org.zodiac.template.base.impl;
import static org.zodiac.core.context.ext.util.DomUtil.*;
import static org.zodiac.core.context.ext.util.SpringExtUtil.*;
import java.util.Map;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
import org.zodiac.core.constants.ServicesNamespaceConstants;
import org.zodiac.core.context.ext.ConfigurationPoint;
import org.zodiac.core.context.ext.Contribution;
import org.zodiac.core.context.ext.ContributionAware;
import org.zodiac.core.context.ext.support.parser.AbstractNamedBeanDefinitionParser;
import org.zodiac.sdk.toolkit.util.AssertUtil;
import org.zodiac.sdk.toolkit.util.file.FileToolUtil;
import org.zodiac.sdk.toolkit.util.lang.StrUtil;
import org.zodiac.template.base.constants.TemplateNamespaceConstants;
public class TemplateServiceDefinitionParser extends AbstractNamedBeanDefinitionParser
implements ContributionAware {
private ConfigurationPoint templateEnginesConfigurationPoint;
public void setContribution(Contribution contrib) {
this.templateEnginesConfigurationPoint = getSiblingConfigurationPoint(String.format("%s/%s/%s",
ServicesNamespaceConstants.SERVICES_NAMESPACE, TemplateNamespaceConstants.TEMPLATE_NAMESPACE,
TemplateNamespaceConstants.ENGINES_NAMESPACE), contrib);
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
parseBeanDefinitionAttributes(element, parserContext, builder);
Map