Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7fd84af6b174bbf5a0125b2ad76b607cbb9d2f9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
 * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.common.model;

import org.eclipse.emf.ecore.EPackage;

/**
 * @author Eike Stepper
 * @since 2.0
 */
public interface CDOPackageUnit extends Comparable<CDOPackageUnit>
{
  public CDOPackageRegistry getPackageRegistry();

  public String getID();

  public State getState();

  public Type getType();

  public Type getOriginalType();

  public long getTimeStamp();

  public CDOPackageInfo getTopLevelPackageInfo();

  public CDOPackageInfo getPackageInfo(String packageURI);

  public CDOPackageInfo[] getPackageInfos();

  public EPackage[] getEPackages(boolean loadOnDemand);

  public boolean isSystem();

  /**
   * @author Eike Stepper
   */
  public enum State
  {
    NEW, LOADED, PROXY, DISPOSED
  }

  /**
   * @author Eike Stepper
   */
  public enum Type
  {
    NATIVE, LEGACY, DYNAMIC, UNKNOWN;

    public boolean isGenerated()
    {
      checkNotUnknown();
      return this == NATIVE || this == LEGACY;
    }

    public void checkNotUnknown()
    {
      if (this == UNKNOWN)
      {
        throw new IllegalStateException("Package unit type is unknown");
      }
    }
  }
}

Back to the top