01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: /**
21: *
22: */package org.netbeans.modules.bpel.model.spi;
23:
24: import java.util.Set;
25: import javax.xml.namespace.QName;
26:
27: import org.netbeans.modules.bpel.model.api.BpelContainer;
28: import org.netbeans.modules.bpel.model.api.BpelEntity;
29: import org.netbeans.modules.bpel.model.api.ExtensibleElements;
30: import org.netbeans.modules.bpel.model.api.ExtensionEntity;
31: import org.netbeans.modules.bpel.model.impl.BpelBuilderImpl;
32: import org.w3c.dom.Element;
33:
34: /**
35: * @author ads
36: *
37: */
38: public interface EntityFactory {
39:
40: /**
41: * Checks either <code>namespaceUri</code> is applicable for this factory.
42: * @param namespaceUri Namespace for check.
43: * @return true if this factory is applicable.
44: */
45: boolean isApplicable(String namespaceUri);
46:
47: /**
48: * @return Set with qNames of elements that this factory supports.
49: */
50: Set<QName> getElementQNames();
51:
52: /**
53: * Creates new entity for specified <code>element</code> inside parent
54: * <code>container</code>.
55: * This method is used inside OM when it parses XML.
56: * @param container Parent object.
57: * @param element DOM low level element.
58: * @return instantiated model entity.
59: */
60: BpelEntity create(BpelContainer container, Element element);
61:
62: /**
63: * Creates unattached OM entity with specified <code>clazz</code>.
64: * This method used by builder for creation element by client.
65: * @param <T> Class OM entity.
66: * @param clazz Type for entity that will be created.
67: * @return instantiated model entity.
68: */
69: <T extends BpelEntity> T create(BpelBuilderImpl builder,
70: Class<T> clazz);
71:
72: boolean canExtend(ExtensibleElements extensible,
73: Class<? extends BpelEntity> extensionType);
74:
75: }
|