xref: /trunk/main/l10ntools/java/receditor/java/transex3/model/ResourceFile.java (revision 3309286857f19787ae62bd793a98b5af4edd2ad3)
1*d127360fSAndrew Rist /**************************************************************
2*d127360fSAndrew Rist  *
3*d127360fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d127360fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d127360fSAndrew Rist  * distributed with this work for additional information
6*d127360fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d127360fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d127360fSAndrew Rist  * "License"); you may not use this file except in compliance
9*d127360fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d127360fSAndrew Rist  *
11*d127360fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d127360fSAndrew Rist  *
13*d127360fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d127360fSAndrew Rist  * software distributed under the License is distributed on an
15*d127360fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d127360fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d127360fSAndrew Rist  * specific language governing permissions and limitations
18*d127360fSAndrew Rist  * under the License.
19*d127360fSAndrew Rist  *
20*d127360fSAndrew Rist  *************************************************************/
21*d127360fSAndrew Rist 
22cdf0e10cSrcweir package transex3.model;
23cdf0e10cSrcweir 
24cdf0e10cSrcweir import java.util.*;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir public class ResourceFile {
27cdf0e10cSrcweir     Vector      sdfStrings      = new Vector();
28cdf0e10cSrcweir     HashMap     sdfHashMap      = new HashMap();
29cdf0e10cSrcweir     String filepathid           = null;
30cdf0e10cSrcweir     String modulename           = null;
31cdf0e10cSrcweir     String filename             = null;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
getModuleName()34cdf0e10cSrcweir     public String getModuleName(){
35cdf0e10cSrcweir         return modulename;
36cdf0e10cSrcweir     }
getFilePath()37cdf0e10cSrcweir     public String getFilePath(){
38cdf0e10cSrcweir         return filepathid;
39cdf0e10cSrcweir     }
getFileName()40cdf0e10cSrcweir     public String getFileName(){
41cdf0e10cSrcweir         return filename;
42cdf0e10cSrcweir     }
43cdf0e10cSrcweir /*  public List readSoureStrings( java.io.File aSdfFile ){
44cdf0e10cSrcweir         List sdfList=null;
45cdf0e10cSrcweir         return sdfList;
46cdf0e10cSrcweir     };*/
addString( SdfString aSdfstring )47cdf0e10cSrcweir     public void addString( SdfString aSdfstring ){
48cdf0e10cSrcweir         sdfStrings.add( aSdfstring );
49cdf0e10cSrcweir         sdfHashMap.put( aSdfstring.getFileId() , aSdfstring );
50cdf0e10cSrcweir         if( filepathid == null )
51cdf0e10cSrcweir             filepathid = aSdfstring.getFilePath();
52cdf0e10cSrcweir         if( modulename == null )
53cdf0e10cSrcweir             modulename = aSdfstring.getModuleName();
54cdf0e10cSrcweir         if( filename == null )
55cdf0e10cSrcweir             filename = aSdfstring.getFileName();
56cdf0e10cSrcweir     }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 
ParseString( String aSourceString )59cdf0e10cSrcweir     public void ParseString( String aSourceString ){
60cdf0e10cSrcweir         //sourceString          = new SdfEntity();
61cdf0e10cSrcweir         SdfEntity aSdfEntity    = new SdfEntity();
62cdf0e10cSrcweir         aSdfEntity.setProperties( aSourceString );
63cdf0e10cSrcweir         SdfString sdfstring     = null;
64cdf0e10cSrcweir         if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ){
65cdf0e10cSrcweir             sdfstring = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() );
66cdf0e10cSrcweir         }
67cdf0e10cSrcweir         else
68cdf0e10cSrcweir         {
69cdf0e10cSrcweir             sdfstring = new SdfString();
70cdf0e10cSrcweir             addString( sdfstring );
71cdf0e10cSrcweir         }
72cdf0e10cSrcweir         sdfstring.addLanguageString( aSdfEntity );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     }
76cdf0e10cSrcweir     /*public void ParseSdfFile( java.util.Vector aSdfList ){
77cdf0e10cSrcweir         ListIterator aLI = aSdfList.listIterator();
78cdf0e10cSrcweir         String current;
79cdf0e10cSrcweir         String[] splitted;
80cdf0e10cSrcweir         SdfEntity aSdfEntity;
81cdf0e10cSrcweir         SdfString aSdfString = new SdfString();
82cdf0e10cSrcweir         while( aLI.hasNext() ){
83cdf0e10cSrcweir             aSdfEntity = new SdfEntity();
84cdf0e10cSrcweir             aSdfEntity.setProperties( (String) aLI.next() );
85cdf0e10cSrcweir             SdfString aString;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir             if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) )
88cdf0e10cSrcweir                 aString = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() );
89cdf0e10cSrcweir             else
90cdf0e10cSrcweir             {
91cdf0e10cSrcweir                 aString = new SdfString();
92cdf0e10cSrcweir                 addString( aString );
93cdf0e10cSrcweir             }
94cdf0e10cSrcweir             aString.addLanguageString( aSdfEntity );
95cdf0e10cSrcweir         }
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     }*/
98cdf0e10cSrcweir }
99