com.github.hammelion.parsers.RAMLParserFacade Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jraml Show documentation
Show all versions of jraml Show documentation
Jraml helps you build your java implementation of REST API, based on specification, described by raml file.
package com.github.hammelion.parsers;
import org.raml.model.Raml;
import org.raml.model.Resource;
import org.raml.parser.visitor.RamlDocumentBuilder;
import javax.inject.Named;
import java.util.HashMap;
import java.util.Map;
/**
* TODO JavaDoc in org.jraml.parsers
*/
@Named
public class RAMLParserFacade {
private Map ramlFiles = new HashMap();
private final RamlDocumentBuilder ramlBuilder = new RamlDocumentBuilder();
public Resource findResource(String ramlFilePath, String resourceKey) {
// TODO Validation List results = RamlValidationService.createDefault().validate(ramlLocation);
Raml raml = this.ramlFiles.get(ramlFilePath);
if (raml == null) {
raml = this.ramlBuilder.build(ramlFilePath);
this.ramlFiles.put(ramlFilePath, raml);
}
return raml.getResource(resourceKey);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy