001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.wsdlextensions.file.model.impl;
021:
022: import org.netbeans.modules.xml.wsdl.model.WSDLModel;
023: import org.w3c.dom.Element;
024:
025: import org.netbeans.modules.wsdlextensions.file.model.FileAddress;
026: import org.netbeans.modules.wsdlextensions.file.model.FileComponent;
027: import org.netbeans.modules.wsdlextensions.file.model.FileQName;
028:
029: /**
030: * @author sweng
031: */
032: public class FileAddressImpl extends FileComponentImpl implements
033: FileAddress {
034: public FileAddressImpl(WSDLModel model, Element e) {
035: super (model, e);
036: }
037:
038: public FileAddressImpl(WSDLModel model) {
039: this (model, createPrefixedElement(FileQName.ADDRESS.getQName(),
040: model));
041: }
042:
043: public void accept(FileComponent.Visitor visitor) {
044: visitor.visit(this );
045: }
046:
047: public void setRelativePath(boolean val) {
048: setAttribute(ATTR_FILE_RELATIVE_PATH,
049: FileAttribute.FILE_ADDRESS_RELATIVEPATH_PROPERTY,
050: val ? "true" : "false");
051: }
052:
053: public boolean getRelativePath() {
054: String s = getAttribute(FileAttribute.FILE_ADDRESS_RELATIVEPATH_PROPERTY);
055: return s != null && s.equals("true");
056: }
057:
058: public void setFileDirectory(String val) {
059: setAttribute(ATTR_FILE_ADDRESS,
060: FileAttribute.FILE_ADDRESS_FILEDIRECTORY_PROPERTY, val);
061: }
062:
063: public String getFileDirectory() {
064: return getAttribute(FileAttribute.FILE_ADDRESS_FILEDIRECTORY_PROPERTY);
065: }
066:
067: public void setPathRelativeTo(String val) {
068: setAttribute(ATTR_FILE_PATH_RELATIVE_TO,
069: FileAttribute.FILE_ADDRESS_PATHRELATIVETO_PROPERTY, val);
070: }
071:
072: public String getPathRelativeTo() {
073: return getAttribute(FileAttribute.FILE_ADDRESS_PATHRELATIVETO_PROPERTY);
074: }
075:
076: public void setLockName(String val) {
077: setAttribute(ATTR_FILE_LOCK_NAME,
078: FileAttribute.FILE_ADDRESS_LOCK_NAME, val);
079: }
080:
081: public String getLockName() {
082: return getAttribute(FileAttribute.FILE_ADDRESS_LOCK_NAME);
083: }
084:
085: public void setWorkArea(String val) {
086: setAttribute(ATTR_FILE_WORK_AREA,
087: FileAttribute.FILE_ADDRESS_WORK_AREA, val);
088: }
089:
090: public String getWorkArea() {
091: return getAttribute(FileAttribute.FILE_ADDRESS_WORK_AREA);
092: }
093:
094: public void setSeqName(String val) {
095: setAttribute(ATTR_FILE_SEQ_NAME,
096: FileAttribute.FILE_ADDRESS_SEQ_NAME, val);
097: }
098:
099: public String getSeqName() {
100: return getAttribute(FileAttribute.FILE_ADDRESS_SEQ_NAME);
101: }
102:
103: }
|