com.softicar.platform.common.core.java.classes.analyzer.AnalyzedJavaClassAnnotation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.java.classes.analyzer;
import com.softicar.platform.common.core.java.classes.name.JavaClassName;
public class AnalyzedJavaClassAnnotation {
private final JavaClassName className;
public AnalyzedJavaClassAnnotation(String descriptor) {
if (descriptor.startsWith("L") && descriptor.endsWith(";")) {
this.className = new JavaClassName(descriptor.substring(1, descriptor.length() - 1));
} else {
throw new RuntimeException(String.format("Illegal annotation descriptor '%s'.", descriptor));
}
}
public JavaClassName getClassName() {
return className;
}
public boolean is(Class annotationClass) {
return is(new JavaClassName(annotationClass));
}
public boolean is(JavaClassName className) {
return className.equals(this.className);
}
}