1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package com.sun.star.script.framework.container;
25 import java.util.Map;
26 import java.util.HashMap;
27 public class ScriptEntry implements Cloneable {
28 
29     private String language;
30     private String languagename;
31     private String location;
32     private String logicalname = "";
33     private String description = "";
34 
35     private Map languagedepprops;
36 
ScriptEntry(String language, String languagename, String logicalname, String location)37     public ScriptEntry(String language, String languagename,
38                        String logicalname, String location) {
39         this.language = language;
40         this.languagename = languagename;
41         // logical name/ function name concept
42         // needs to be reworked, in meantime
43         // function name ( from xml ) will be used
44         // as logical name also
45         this.logicalname = languagename;
46         this.location = location;
47         this.languagedepprops =  new HashMap();
48     }
49 
ScriptEntry(ScriptEntry entry)50     public ScriptEntry(ScriptEntry entry)
51     {
52         this.language = entry.language;
53         this.languagename = entry.languagename;
54         this.logicalname = entry.languagename;
55         this.location = entry.location;
56         this.languagedepprops = entry.languagedepprops;
57         this.description = entry.description;
58     }
59 
ScriptEntry(String language, String languagename, String logicalname, String location, Map languagedepprops)60     public ScriptEntry(String language, String languagename,
61                        String logicalname, String location, Map languagedepprops) {
62         this( language, languagename, logicalname, location );
63         this.languagedepprops = languagedepprops;
64     }
65 
ScriptEntry(String language, String languagename, String logicalname, String location, Map languagedepprops, String description)66     public ScriptEntry(String language, String languagename,
67                        String logicalname, String location,
68                        Map languagedepprops, String description) {
69         this( language, languagename, logicalname, location );
70         this.languagedepprops = languagedepprops;
71         this.description = description;
72     }
73 
ScriptEntry(String languagename, String location)74     public ScriptEntry(String languagename, String location) {
75         this("Java", languagename, languagename, location);
76     }
77 
clone()78     public Object clone() throws CloneNotSupportedException {
79         return super.clone();
80     }
81 
equals(ScriptEntry other)82     public boolean equals(ScriptEntry other) {
83         if (language.equals(other.getLanguage()) &&
84             languagename.equals(other.getLanguageName()) &&
85             logicalname.equals(other.getLogicalName()) &&
86             languagedepprops.equals(other.getLanguageProperties()) &&
87             location.equals(other.getLocation()))
88             return true;
89         return false;
90     }
91 
getLanguageProperties()92     public Map getLanguageProperties()
93     {
94         return languagedepprops;
95     }
96 
getLanguageName()97     public String getLanguageName() {
98         return languagename;
99     }
100 
getLogicalName()101     public String getLogicalName() {
102         return logicalname;
103     }
104 
setLogicalName(String name)105     public void setLogicalName(String name) {
106         logicalname = name;
107     }
108 
getLanguage()109     public String getLanguage() {
110         return language;
111     }
112 
getLocation()113     public String getLocation() {
114         return location;
115     }
116 
getDescription()117     public String getDescription() {
118         return description;
119     }
120 
toString()121     public String toString() {
122         return "\nLogicalName = " + logicalname +  "\nLanguageName = " + languagename + "\nLocation = " + location + "\nLanguaguageProperties = " + languagedepprops;
123     }
124 }
125