trait Package extends AnyRef

A virtual Package constructed from metadata.

Packages must be created in the context of a specific Org. Each Package manages a set of Types which are created from the metadata of the package. Once constructed you can use the package APIs to introspect dependency relationships between Types, obtain summary information about Types and replace or delete Types.

A key concept to understand in this API is that a Type may be created from multiple metadata files, e.g. the System.Labels Type is always present but can be constructed from several labels files. The API methods expose Types via the TypeIdentifiers which you don't need to understand to use the API as long as you keep in mind the 1:M mapping between Types and Paths.

The term dependency can be rather ambiguous, we use it here to mean a 'using' relationship. So if class A calls a method on class B, we say A has a dependency that is B. The reverse relationship is a 'dependency holder', so B has a dependency holder that is A. Transitives of dependencies or dependency holder relationships are not exposed by these APIs but can be easily obtained by recursive iteration.

A Summary provides a way of looking at the structure of Types. In summary form only the most important details are provided but it is essentially free to access since it is the same format used in the disk cache.

Packages only handle metadata that is important to Apex class analysis, other forms of metadata that might appear in the package directory are ignored.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Package
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def getDependencies(typeId: TypeIdentifier, outerInheritanceOnly: Boolean, apexOnly: Boolean): Array[TypeIdentifier]

    Returns set of Types that are depended on by the passed Type

    Returns set of Types that are depended on by the passed Type

    If outerInheritanceOnly is true only extending and implementing dependencies are reported for the outer Type of Apex defined types. If apexOnly is true then only Apex defined types are returned.

  2. abstract def getDependencyHolders(typeId: TypeIdentifier, apexOnly: Boolean): Array[TypeIdentifier]

    Returns set of Types that depend on the passed Type.

    Returns set of Types that depend on the passed Type.

    The returned array may be stale in that it can contain Types which used to hold a dependency but not longer do. If apexOnly is true then only Apex defined types are returned.

  3. abstract def getNamespaces(withDependents: Boolean): Array[String]

    The namespace of the package or the package and its dependent packages.

    The namespace of the package or the package and its dependent packages.

    An empty namespace indicates the "unmanaged" package.

  4. abstract def getPathsOfType(typeId: TypeIdentifier): Array[String]

    Get the path(s) of the metadata file that defined a Type.

    Get the path(s) of the metadata file that defined a Type.

    Returns an empty array if the Type is not defined within the current package.

  5. abstract def getSummaryOfType(typeId: TypeIdentifier): TypeSummary

    Get the summary information for a Type.

    Get the summary information for a Type.

    Returns a null if the Type is not defined within the current package.

  6. abstract def getSummaryOfTypeAsJSON(typeId: TypeIdentifier): String

    JSON encoding of summary information for a type.

    JSON encoding of summary information for a type.

    Returns a null if the Type is not defined within the current package.

  7. abstract def getTypeIdentifier(typeName: TypeName): TypeIdentifier

    Get a TypeIdentifier for a TypeName resolved against this package.

    Get a TypeIdentifier for a TypeName resolved against this package.

    Returns null if the TypeName is not visible in this package.

  8. abstract def getTypeIdentifiers(apexOnly: Boolean): Array[TypeIdentifier]

    Get a list of type identifiers available in from this package.

    Get a list of type identifiers available in from this package. This is not all available type identifiers, but just those that will make most sense to list in an IDE for selection.

    Returns an array which may be empty.

  9. abstract def getTypeOfPath(path: String): TypeIdentifier

    Get a Type from the path of a metadata file.

    Get a Type from the path of a metadata file.

    Returns a null if the path does not identify metadata that creates a Type within the current package.

  10. abstract def hasDependency(typeId: TypeIdentifier, dependencyTypeId: TypeIdentifier): Boolean

    Returns true if the type identified by typeId depends in the type identified by dependencyTypeId.

    Returns true if the type identified by typeId depends in the type identified by dependencyTypeId.

    This will return true where the type depends on an inner class of dependencyTypeId. All dependencies of typeId are considered including those of any inner class.

  11. abstract def isPackagePath(path: String): Boolean

    Test if a metadata file path is part of this package.

    Test if a metadata file path is part of this package.

    Return null if this either not a recognised metadata file type or it is not part of this package.

  12. abstract def refresh(path: String, highPriority: Boolean): Unit

    Refresh a type in the package.

    Refresh a type in the package.

    This registers that the metadata in a file may need updating. The refresh is queued until the Org metadata is next flushed so that changes are made in batches for efficiency. Refreshing causes dependent metadata to be re-validated so issues may be reported against other metadata types after the flush has completed.

    If there is no file at the given path then any previous contribution to the package metadata from this file will be removed so you call this after file deletion.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped