| /*=============================================================================# |
| # Copyright (c) 2007, 2019 Stephan Wahlbrink and others. |
| # |
| # This program and the accompanying materials are made available under the |
| # terms of the Eclipse Public License 2.0 which is available at |
| # https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 |
| # which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| # |
| # Contributors: |
| # Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.ltk.model.core.elements; |
| |
| import java.util.List; |
| |
| import org.eclipse.core.runtime.IAdaptable; |
| |
| import org.eclipse.statet.ltk.core.ElementName; |
| |
| |
| /** |
| * Interface for all types of elements in the ltk model |
| */ |
| public interface IModelElement extends IAdaptable { |
| |
| |
| interface Filter { |
| |
| boolean include(IModelElement element); |
| |
| } |
| |
| |
| static final int MASK_C1= 0xf00; |
| static final int SHIFT_C1= 8; |
| static final int MASK_C2= 0xff0; |
| static final int MASK_C3= 0xfff; |
| |
| static final int C1_BUNDLE= 0x100; |
| static final int C1_SOURCE= 0x200; |
| static final int C1_IMPORT= 0x300; |
| static final int C1_CLASS= 0x400; |
| static final int C1_METHOD= 0x500; |
| static final int C1_VARIABLE= 0x600; |
| static final int C1_EMBEDDED= 0x800; |
| |
| static final int C2_SOURCE_FILE= C1_SOURCE | 0x10; |
| static final int C2_SOURCE_CHUNK= C1_SOURCE | 0x80; |
| |
| |
| String getModelTypeId(); |
| |
| int getElementType(); |
| ElementName getElementName(); |
| String getId(); |
| |
| boolean exists(); |
| boolean isReadOnly(); |
| |
| IModelElement getModelParent(); |
| boolean hasModelChildren(Filter filter); // can also be used to visit children |
| List<? extends IModelElement> getModelChildren(Filter filter); |
| |
| |
| } |