Package protobuf.lang.psi.impl.declaration

Source Code of protobuf.lang.psi.impl.declaration.PbPackageDefImpl

package protobuf.lang.psi.impl.declaration;

import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import protobuf.lang.psi.api.declaration.PbPackageDef;
import protobuf.lang.psi.api.reference.PbRef;
import protobuf.lang.psi.impl.PbPsiElementImpl;

/**
* @author Nikolay Matveev
* Date: Mar 10, 2010
*/
public class PbPackageDefImpl extends PbPsiElementImpl implements PbPackageDef {
   
    public PbPackageDefImpl(ASTNode node){
        super(node);
    }

    @Override
    public String getPackageName() {
        final PbRef packageRef = findChildByClass(PbRef.class);
        if(packageRef == null){
            return "";
        }
        PsiElement el = packageRef.getElement();
        String packageName = el != null ? el.getText() : null;
        return packageName;
    }
}
TOP

Related Classes of protobuf.lang.psi.impl.declaration.PbPackageDefImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.