package ru.yandex.autotests.direct.analyzer.perl;

import ru.yandex.autotests.direct.analyzer.lexer.Lexem;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by alexey-n on 18.11.14.
 */
public class PerlUse {

    private List<Lexem> useDeclaration;

    public PerlUse() {
        useDeclaration = new ArrayList<Lexem>();
    }

    public List<Lexem> getUseDeclaration() {
        return useDeclaration;
    }

    public void setUseDeclaration(List<Lexem> useDeclaration) {
        this.useDeclaration = useDeclaration;
    }

    public String getUseString() {
        String result = "";
        for(Lexem lexem:useDeclaration) {
            if (lexem.getName().equals("UsedName")
                    || lexem.getName().equals("Namespace")
                    || lexem.getName().equals("NamespaceResolver")) {
                result += lexem.getData();
            }
        }
        return result;
    }
}
