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 package transex3.model; 23 24 import java.util.*; 25 26 public class ResourceFile { 27 Vector sdfStrings = new Vector(); 28 HashMap sdfHashMap = new HashMap(); 29 String filepathid = null; 30 String modulename = null; 31 String filename = null; 32 33 getModuleName()34 public String getModuleName(){ 35 return modulename; 36 } getFilePath()37 public String getFilePath(){ 38 return filepathid; 39 } getFileName()40 public String getFileName(){ 41 return filename; 42 } 43 /* public List readSoureStrings( java.io.File aSdfFile ){ 44 List sdfList=null; 45 return sdfList; 46 };*/ addString( SdfString aSdfstring )47 public void addString( SdfString aSdfstring ){ 48 sdfStrings.add( aSdfstring ); 49 sdfHashMap.put( aSdfstring.getFileId() , aSdfstring ); 50 if( filepathid == null ) 51 filepathid = aSdfstring.getFilePath(); 52 if( modulename == null ) 53 modulename = aSdfstring.getModuleName(); 54 if( filename == null ) 55 filename = aSdfstring.getFileName(); 56 } 57 58 ParseString( String aSourceString )59 public void ParseString( String aSourceString ){ 60 //sourceString = new SdfEntity(); 61 SdfEntity aSdfEntity = new SdfEntity(); 62 aSdfEntity.setProperties( aSourceString ); 63 SdfString sdfstring = null; 64 if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ){ 65 sdfstring = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); 66 } 67 else 68 { 69 sdfstring = new SdfString(); 70 addString( sdfstring ); 71 } 72 sdfstring.addLanguageString( aSdfEntity ); 73 74 75 } 76 /*public void ParseSdfFile( java.util.Vector aSdfList ){ 77 ListIterator aLI = aSdfList.listIterator(); 78 String current; 79 String[] splitted; 80 SdfEntity aSdfEntity; 81 SdfString aSdfString = new SdfString(); 82 while( aLI.hasNext() ){ 83 aSdfEntity = new SdfEntity(); 84 aSdfEntity.setProperties( (String) aLI.next() ); 85 SdfString aString; 86 87 if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ) 88 aString = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); 89 else 90 { 91 aString = new SdfString(); 92 addString( aString ); 93 } 94 aString.addLanguageString( aSdfEntity ); 95 } 96 97 }*/ 98 } 99