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

poussecafe.doc.model.ClassDocRepository Maven / Gradle / Ivy

There is a newer version: 0.29.0
Show newest version
package poussecafe.doc.model;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.lang.model.element.TypeElement;
import poussecafe.domain.Service;
import poussecafe.exception.NotFoundException;

public class ClassDocRepository implements Service {

    public void registerTypeElements(Set typeElements) {
        typeElements.forEach(this::registerClassDoc);
    }

    public void registerClassDoc(TypeElement typeElement) {
        classDocMap.put(typeElement.getQualifiedName().toString(), typeElement);
    }

    private Map classDocMap = new HashMap<>();

    public TypeElement getClassDoc(String qualifiedName) {
        TypeElement classDoc = classDocMap.get(qualifiedName);
        if(classDoc == null) {
            throw new NotFoundException("No class with name " + qualifiedName);
        }
        return classDoc;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy