01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.lib.meta;
20:
21: import java.io.File;
22:
23: /**
24: * Interface that can optionally be implemented by metadata
25: * to include the source file from which the metadata was originally parsed.
26: *
27: * @author Abe White
28: */
29: public interface SourceTracker {
30:
31: public static final int SRC_OTHER = 0;
32: public static final int SRC_ANNOTATIONS = 1;
33: public static final int SRC_XML = 2;
34:
35: /**
36: * Return the file from which this instance was parsed.
37: */
38: public File getSourceFile();
39:
40: /**
41: * Return the domain-dependent scope of this instance within its file.
42: */
43: public Object getSourceScope();
44:
45: /**
46: * Return the type of source.
47: */
48: public int getSourceType();
49:
50: /**
51: * Return the domain-meaningful name of the resource that was loaded
52: * from this source. I.e., if we had loaded the source for a Java
53: * class, this would return the name of the class.
54: */
55: public String getResourceName();
56: }
|