org.jboss.weld.metadata.FileMetadata Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weld-osgi-bundle Show documentation
Show all versions of weld-osgi-bundle Show documentation
Weld runtime packaged as an OSGi bundle
package org.jboss.weld.metadata;
import org.jboss.weld.bootstrap.spi.Metadata;
import java.net.URL;
public class FileMetadata implements Metadata {
private final T value;
private final URL file;
private final int lineNumber;
public FileMetadata(T value, URL file, int lineNumber) {
this.value = value;
this.file = file;
this.lineNumber = lineNumber;
}
public String getLocation() {
if (value != null) {
return file.toString() + "@" + lineNumber + "[" + value + "]";
} else {
return file.toString() + "@" + lineNumber;
}
}
public T getValue() {
return value;
}
public URL getFile() {
return file;
}
public int getLineNumber() {
return lineNumber;
}
@Override
public String toString() {
return getLocation();
}
}