com.hadii.clarpse.reference.ComponentReference Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarpse Show documentation
Show all versions of clarpse Show documentation
Clarpse is a lightweight polyglot source code analysis tool.
package com.hadii.clarpse.reference;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.io.Serializable;
/**
* Represents a reference to another component in the code base.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@Type(value = SimpleTypeReference.class, name = "simple"),
@Type(value = TypeExtensionReference.class, name = "extension"),
@Type(value = TypeImplementationReference.class, name = "implementation")})
public abstract class ComponentReference implements Serializable, Cloneable {
private static final long serialVersionUID = -242718695900611890L;
private String invokedComponent = "";
public ComponentReference(final String invocationComponentName, final int lineNum) {
invokedComponent = invocationComponentName;
}
public ComponentReference(final ComponentReference invocation) {
invokedComponent = invocation.invokedComponent();
}
public ComponentReference() {
}
@Override
public String toString() {
return getClass().getSimpleName() + ":" + invokedComponent;
}
public ComponentReference(String invokedComponent2) {
invokedComponent = invokedComponent2;
}
public String invokedComponent() {
return invokedComponent;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy