## org.eclipse.emf.mint.util
Class ItemJavaElementDescriptor

    java.lang.Object
      org.eclipse.emf.mint.util.ItemJavaElementDescriptor

All Implemented Interfaces:
  IItemJavaElementDescriptor

    public class ItemJavaElementDescriptor

extends Object
implements IItemJavaElementDescriptor

Default implementation of `IItemJavaElementDescriptor`.

Clients may extend or instantiate this class.

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.emf.mint.IItemJavaElementDescriptor
`IItemJavaElementDescriptor.Kind`

Constructor Summary
`protected` `ItemJavaElementDescriptor(IItemJavaElementDescriptor.Kind kind, org.eclipse.jdt.core.IJavaElement javaElement, IJavaTypeReference javaTypeReference, Object nonJavaElement, String category, String description, String displayName, Object feature)` Convenience constructor for setting all encapsulated fields in one place.
`` `ItemJavaElementDescriptor(org.eclipse.jdt.core.IJavaElement javaElement, String category, String description, String displayName, Object feature)` Creates an instance with a specific Java element.
`` `ItemJavaElementDescriptor(org.eclipse.jdt.core.IJavaProject context, String typeName, String category, String description, String displayName, Object feature)` Creates an instance with an unresolved reference to a Java type in the context of a project.
`` `ItemJavaElementDescriptor(Object nonJavaElement, String category, String description, String displayName, Object feature)` Creates an instance with a non-Java element.

Method Summary
`boolean` `equals(Object obj)`
`String` `getCategory(Object object)` Returns an optional category used for grouping descriptors.
`String` `getDescription(Object object)` Returns an optional description of the Java code facet that this descriptor represents.
`String` `getDisplayName(Object object)` Returns a display name for the Java element that this descriptor represents for the given model element.
`Object` `getFeature(Object object)` Returns an optional related feature that this descriptor represents.
`org.eclipse.jdt.core.IJavaElement` `getJavaElement(Object object)` Returns a specific Java element for the given model element.
`IJavaTypeReference` `getJavaTypeReference(Object object)` Returns an unresolved Java element reference for the given model element.
`IItemJavaElementDescriptor.Kind` `getKind(Object object)` Returns this descriptor's kind for the given model element.
`Object` `getNonJavaElement(Object object)` Returns the non-Java element for the given model element.
`int` `hashCode()`
`String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ItemJavaElementDescriptor

    public ItemJavaElementDescriptor(org.eclipse.jdt.core.IJavaElement javaElement,
                                     String category,
                                     String description,
                                     String displayName,
                                     Object feature)

  Creates an instance with a specific Java element. All other arguments are optional.

  Parameters:
    `javaElement` - the described Java element
    `category` - category used to group descriptors
    `description` - description
    `displayName` - display name
    `feature` - related feature, if any

### ItemJavaElementDescriptor

    public ItemJavaElementDescriptor(org.eclipse.jdt.core.IJavaProject context,
                                     String typeName,
                                     String category,
                                     String description,
                                     String displayName,
                                     Object feature)

  Creates an instance with an unresolved reference to a Java type in the context of a project. All other arguments are optional.

  Parameters:
    `context` - Java project in whose context the type should be resolvable
    `typeName` - name of the referenced Java type
    `category` - category used to group descriptors
    `description` - description
    `displayName` - display name
    `feature` - related feature, if any

### ItemJavaElementDescriptor

    public ItemJavaElementDescriptor(Object nonJavaElement,
                                     String category,
                                     String description,
                                     String displayName,
                                     Object feature)

  Creates an instance with a non-Java element. All other arguments are optional.

  Parameters:
    `nonJavaElement` - non-Java element
    `category` - category used to group descriptors
    `description` - description
    `displayName` - display name
    `feature` - related feature, if any

### ItemJavaElementDescriptor

    protected ItemJavaElementDescriptor(IItemJavaElementDescriptor.Kind kind,
                                        org.eclipse.jdt.core.IJavaElement javaElement,
                                        IJavaTypeReference javaTypeReference,
                                        Object nonJavaElement,
                                        String category,
                                        String description,
                                        String displayName,
                                        Object feature)

  Convenience constructor for setting all encapsulated fields in one place.

  Parameters:
    `kind` - element kind
    `javaElement` - java element (either the element or the reference are required)
    `javaTypeReference` - java type reference (either the reference or the element are required)
    `nonJavaElement` - non-Java element
    `category` - category
    `description` - description
    `displayName` - display name
    `feature` - related feature, if any

Method Detail

### getKind

    public IItemJavaElementDescriptor.Kind getKind(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns this descriptor's kind for the given model element.

  Specified by:
    `getKind` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    descriptor kind

### getJavaElement

    public org.eclipse.jdt.core.IJavaElement getJavaElement(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns a specific Java element for the given model element.

  Specified by:
    `getJavaElement` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    Java element for the given model element
  See Also:
    `IItemJavaElementDescriptor.Kind.JAVA_ELEMENT`

### getJavaTypeReference

    public IJavaTypeReference getJavaTypeReference(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns an unresolved Java element reference for the given model element.

  Specified by:
    `getJavaTypeReference` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    Java element reference
  See Also:
    `IItemJavaElementDescriptor.Kind.JAVA_TYPE_REFERENCE`

### getNonJavaElement

    public Object getNonJavaElement(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns the non-Java element for the given model element.

  Specified by:
    `getNonJavaElement` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    non-Java element for the given model element
  See Also:
    `IItemJavaElementDescriptor.Kind.NON_JAVA_RESOURCE`

### getCategory

    public String getCategory(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns an optional category used for grouping descriptors.

  Specified by:
    `getCategory` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    category used for grouping descriptors (may be `null`)

### getDescription

    public String getDescription(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns an optional description of the Java code facet that this descriptor represents.

  Specified by:
    `getDescription` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    Java element description (i.e., how it relates to the model element)F

### getDisplayName

    public String getDisplayName(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns a display name for the Java element that this descriptor represents for the given model element.

  Specified by:
    `getDisplayName` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    Java element's display name (i.e., what it represents for the given model element)

### getFeature

    public Object getFeature(Object object)

  Description copied from interface: `IItemJavaElementDescriptor`
  Returns an optional related feature that this descriptor represents.

  Specified by:
    `getFeature` in interface `IItemJavaElementDescriptor`
  Parameters:
    `object` - model element
  Returns:
    feature related to this descriptor (may be `null`)

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Copyright 2008, 2009 Ecliptical Software Inc. and others. All Rights Reserved.