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.impl;
23:
24: import java.util.concurrent.atomic.AtomicReference;
25:
26: import org.netbeans.modules.bpel.model.api.Expression;
27: import org.netbeans.modules.bpel.model.api.events.VetoException;
28: import org.netbeans.modules.bpel.model.xam.BpelAttributes;
29: import org.netbeans.modules.xml.xam.dom.Attribute;
30: import org.w3c.dom.Element;
31:
32: /**
33: * @author ads
34: *
35: */
36: public abstract class ExpressionImpl extends BpelEntityImpl implements
37: Expression {
38:
39: ExpressionImpl(BpelModelImpl model, Element e) {
40: super (model, e);
41: }
42:
43: ExpressionImpl(BpelBuilderImpl builder, String tagName) {
44: super (builder, tagName);
45: }
46:
47: /* (non-Javadoc)
48: * @see org.netbeans.modules.soa.model.bpel20.api.ContentElement#getContent()
49: */
50: public String getContent() {
51: return getCorrectedText();
52: }
53:
54: /* (non-Javadoc)
55: * @see org.netbeans.modules.soa.model.bpel20.api.ContentElement#setContent(java.lang.String)
56: */
57: public void setContent(String content) throws VetoException {
58: setText(content);
59: }
60:
61: /* (non-Javadoc)
62: * @see org.netbeans.modules.soa.model.bpel20.api.ExpressionLanguageSpec#getExpressionLanguage()
63: */
64: public String getExpressionLanguage() {
65: return getAttribute(BpelAttributes.EXPRESSION_LANGUAGE);
66: }
67:
68: /* (non-Javadoc)
69: * @see org.netbeans.modules.soa.model.bpel20.api.ExpressionLanguageSpec#setExpressionLanguage(java.lang.String)
70: */
71: public void setExpressionLanguage(String value)
72: throws VetoException {
73: setBpelAttribute(BpelAttributes.EXPRESSION_LANGUAGE, value);
74: }
75:
76: /* (non-Javadoc)
77: * @see org.netbeans.modules.soa.model.bpel20.api.ExpressionLanguageSpec#removeExpressionLanguage()
78: */
79: public void removeExpressionLanguage() {
80: removeAttribute(BpelAttributes.EXPRESSION_LANGUAGE);
81: }
82:
83: /* (non-Javadoc)
84: * @see org.netbeans.modules.soa.model.bpel20.impl.BpelEntityImpl#getDomainAttributes()
85: */
86: protected Attribute[] getDomainAttributes() {
87: if (myAttributes.get() == null) {
88: Attribute[] ret = new Attribute[] { BpelAttributes.CONTENT,
89: BpelAttributes.EXPRESSION_LANGUAGE };
90: myAttributes.compareAndSet(null, ret);
91: }
92: return myAttributes.get();
93: }
94:
95: private static AtomicReference<Attribute[]> myAttributes = new AtomicReference<Attribute[]>();
96: }
|