// Path: src/org/gololang/netbeans/lexer/GoloTokenId.java
// public class GoloTokenId implements TokenId {
// 
//     private final String name;
//     private final String primaryCategory;
//     private final int id;
// 
//     public static Language<GoloTokenId> getLanguage() {
//         return new GoloLanguageHierarchy().language();
//     }
//     
//     public GoloTokenId(
//             String name,
//             String primaryCategory,
//             int id) {
//         this.name = name;
//         this.primaryCategory = primaryCategory;
//         this.id = id;
//     }
// 
//     @Override
//     public String primaryCategory() {
//         return primaryCategory;
//     }
// 
//     @Override
//     public int ordinal() {
//         return id;
//     }
// 
//     @Override
//     public String name() {
//         return name;
//     }
// 
// }


import static java.lang.reflect.Modifier.isAbstract;
import static java.lang.reflect.Modifier.isPrivate;
import static java.lang.reflect.Modifier.isProtected;
import static java.lang.reflect.Modifier.isPublic;
import static java.lang.reflect.Modifier.isStatic;
import java.util.HashSet;
import java.util.Set;
import org.gololang.netbeans.lexer.GoloTokenId;
import org.netbeans.modules.csl.api.ElementHandle;
import org.netbeans.modules.csl.api.ElementKind;
import org.netbeans.modules.csl.api.Modifier;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.csl.spi.ParserResult;
import org.openide.filesystems.FileObject;
/*
 *  Copyright 2013 SERLI (www.serli.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 */
package org.gololang.netbeans.structure;


/**
 *
 * @author Guillaume Soldera <guillaume.soldera@serli.com>
 */
public class SimpleGoloElementHandle implements ElementHandle {

    private final FileObject fileObject;
    private final Set<Modifier> modifiers;
    private final String elementName;
    private final ElementKind elementKind;
    private final String fromClassName;

    public SimpleGoloElementHandle(FileObject fileObject, String fromClassName, String elementName, ElementKind elementKind, Set<Modifier> modifiers) {
        this.fileObject = fileObject;
        this.elementName = elementName;
        this.modifiers = modifiers;
        this.elementKind = elementKind;
        this.fromClassName = fromClassName;
    }

    @Override
    public FileObject getFileObject() {
        return fileObject;
    }

    @Override
    public String getMimeType() {
        if (fileObject != null) {
            return fileObject.getMIMEType();
        }
        // default value golo mime type or 'application/java-vm' ?
// Path: src/org/gololang/netbeans/lexer/GoloTokenId.java
// public class GoloTokenId implements TokenId {
// 
//     private final String name;
//     private final String primaryCategory;
//     private final int id;
// 
//     public static Language<GoloTokenId> getLanguage() {
//         return new GoloLanguageHierarchy().language();
//     }
//     
//     public GoloTokenId(
//             String name,
//             String primaryCategory,
//             int id) {
//         this.name = name;
//         this.primaryCategory = primaryCategory;
//         this.id = id;
//     }
// 
//     @Override
//     public String primaryCategory() {
//         return primaryCategory;
//     }
// 
//     @Override
//     public int ordinal() {
//         return id;
//     }
// 
//     @Override
//     public String name() {
//         return name;
//     }
// 
// }


// Path: src/org/gololang/netbeans/structure/SimpleGoloElementHandle.java
import static java.lang.reflect.Modifier.isAbstract;
import static java.lang.reflect.Modifier.isPrivate;
import static java.lang.reflect.Modifier.isProtected;
import static java.lang.reflect.Modifier.isPublic;
import static java.lang.reflect.Modifier.isStatic;
import java.util.HashSet;
import java.util.Set;
import org.gololang.netbeans.lexer.GoloTokenId;
import org.netbeans.modules.csl.api.ElementHandle;
import org.netbeans.modules.csl.api.ElementKind;
import org.netbeans.modules.csl.api.Modifier;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.csl.spi.ParserResult;
import org.openide.filesystems.FileObject;

/*
 *  Copyright 2013 SERLI (www.serli.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 */
package org.gololang.netbeans.structure;


/**
 *
 * @author Guillaume Soldera <guillaume.soldera@serli.com>
 */
public class SimpleGoloElementHandle implements ElementHandle {

    private final FileObject fileObject;
    private final Set<Modifier> modifiers;
    private final String elementName;
    private final ElementKind elementKind;
    private final String fromClassName;

    public SimpleGoloElementHandle(FileObject fileObject, String fromClassName, String elementName, ElementKind elementKind, Set<Modifier> modifiers) {
        this.fileObject = fileObject;
        this.elementName = elementName;
        this.modifiers = modifiers;
        this.elementKind = elementKind;
        this.fromClassName = fromClassName;
    }

    @Override
    public FileObject getFileObject() {
        return fileObject;
    }

    @Override
    public String getMimeType() {
        if (fileObject != null) {
            return fileObject.getMIMEType();
        }
        // default value golo mime type or 'application/java-vm' ?
        return GoloTokenId.getLanguage().mimeType();