Class SourceConstruct

java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.handly.model.impl.support.Element
org.eclipse.handly.model.impl.support.SourceConstruct
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IElement, IElementImpl, IElementImplExtension, ISourceConstructImpl, ISourceConstructImplExtension, ISourceElementImpl, IElementImplSupport, IModelManager.Provider, ISourceConstructImplSupport, ISourceElementImplSupport, ISourceConstruct, ISourceElement

public abstract class SourceConstruct extends Element implements ISourceConstructImplSupport
Provides a skeletal implementation of ISourceConstructImplExtension to minimize the effort required to implement that interface. Clients might as well implement ("mix in") ISourceConstructImplSupport directly if extending this class is not possible/desirable for some reason.
  • Constructor Details

    • SourceConstruct

      public SourceConstruct(IElement parent, String name)
      Creates a handle for a source construct with the given parent element and the given name.
      Parameters:
      parent - the parent of the element (not null)
      name - the name of the element, or null if the element has no name
  • Method Details

    • getOccurrenceCount_

      public final int getOccurrenceCount_()
      Description copied from interface: ISourceConstructImplExtension
      Returns the count used to distinguish source constructs that would otherwise be equal (such as two fields with the same name in the same type). Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0).
      Specified by:
      getOccurrenceCount_ in interface ISourceConstructImplExtension
      Returns:
      the occurrence count for this element
    • setOccurrenceCount_

      public void setOccurrenceCount_(int occurrenceCount)
      Description copied from interface: ISourceConstructImplExtension
      Sets the occurrence count for this element.

      This method is intended to be used only when building the structure of a source file to distinguish source constructs that would otherwise be equal.

      Specified by:
      setOccurrenceCount_ in interface ISourceConstructImplExtension
      Parameters:
      occurrenceCount - the occurrence count for this element (> 0)