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

org.jboss.weld.metadata.FileMetadata Maven / Gradle / Ivy

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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy