Source code: javax/ide/model/spi/ElementFactory.java
1 package javax.ide.model.spi;
2
3 import javax.ide.model.Element;
4
5 /**
6 * Element factory creates instances of Elements from an implementation bridge
7 * object. This should only be used for elements which do not have a URI.
8 * Documents should be created via the DocumentFactory.
9 */
10 public final class ElementFactory
11 {
12 private ElementFactory()
13 {
14 }
15
16 /**
17 * Create a new Element from the specified implementation bridge.
18 *
19 * @param impl the implementation bridge.
20 * @return an element instance.
21 */
22 public static Element createElement( final ElementImpl impl )
23 {
24 return new Element()
25 {
26 protected ElementImpl getElementImpl()
27 {
28 return impl;
29 }
30 };
31 }
32 }