comparison src/java/de/intevation/mxd/reader/FillSymbolReader.java @ 115:fb93f20478cc

Improved exception handling for symbol reader.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 15 Jun 2011 16:48:42 +0200
parents 3087c89a5bb8
children f4eb506499f5
comparison
equal deleted inserted replaced
114:93699e8f2d1f 115:fb93f20478cc
46 logger.debug("contructor(ILineSymbol)"); 46 logger.debug("contructor(ILineSymbol)");
47 this.fillSymbol = symbol; 47 this.fillSymbol = symbol;
48 this.symbol= null; 48 this.symbol= null;
49 } 49 }
50 50
51 public Element read() throws Exception { 51 public Element read() {
52 ISymbolReader sreader = null; 52 ISymbolReader sreader = null;
53 if(symbol != null) { 53 if(symbol != null) {
54 if(symbol instanceof SimpleFillSymbol) { 54 try {
55 sreader = new SimpleFillSymbolReader(symbol); 55 if(symbol instanceof SimpleFillSymbol) {
56 sreader = new SimpleFillSymbolReader(symbol);
57 }
58 else if(symbol instanceof MultiLayerFillSymbol) {
59 sreader = new MultiLayerFillSymbolReader(symbol);
60 }
61 else if(symbol instanceof MarkerFillSymbol) {
62 sreader = new MarkerFillSymbolReader(symbol);
63 }
64 else if(symbol instanceof LineFillSymbol) {
65 sreader = new LineFillSymbolReader(symbol);
66 }
67 else {
68 logger.debug("The reader for type " + symbol.getClass().toString() +
69 " is not implemented!");
70 return parent;
71 }
56 } 72 }
57 else if(symbol instanceof MultiLayerFillSymbol) { 73 catch(Exception e) {
58 sreader = new MultiLayerFillSymbolReader(symbol); 74 logger.error(
59 } 75 "Could not read the symbol " +
60 else if(symbol instanceof MarkerFillSymbol) { 76 symbol.getClass().toString());
61 sreader = new MarkerFillSymbolReader(symbol);
62 }
63 else if(symbol instanceof LineFillSymbol) {
64 sreader = new LineFillSymbolReader(symbol);
65 }
66 else {
67 logger.debug("The reader for type " + symbol.getClass().toString() +
68 " is not implemented!");
69 return parent; 77 return parent;
70 } 78 }
71 } 79 }
72 else if(fillSymbol != null) { 80 else if(fillSymbol != null) {
73 if(fillSymbol instanceof SimpleFillSymbol) { 81 try {
74 sreader = new SimpleFillSymbolReader(fillSymbol); 82 if(fillSymbol instanceof SimpleFillSymbol) {
83 sreader = new SimpleFillSymbolReader(fillSymbol);
84 }
85 else if(fillSymbol instanceof MultiLayerFillSymbol) {
86 sreader = new MultiLayerFillSymbolReader(fillSymbol);
87 }
88 else if(fillSymbol instanceof MarkerFillSymbol) {
89 sreader = new MarkerFillSymbolReader(fillSymbol);
90 }
91 else if(fillSymbol instanceof LineFillSymbol) {
92 sreader = new LineFillSymbolReader(fillSymbol);
93 }
94 else {
95 logger.debug("The reader for type " +
96 fillSymbol.getClass().toString() +
97 " is not implemented!");
98 return parent;
99 }
75 } 100 }
76 else if(fillSymbol instanceof MultiLayerFillSymbol) { 101 catch(Exception e) {
77 sreader = new MultiLayerFillSymbolReader(fillSymbol); 102 logger.error(
78 } 103 "Could not read the symbol " +
79 else if(fillSymbol instanceof MarkerFillSymbol) { 104 symbol.getClass().toString());
80 sreader = new MarkerFillSymbolReader(fillSymbol);
81 }
82 else if(fillSymbol instanceof LineFillSymbol) {
83 sreader = new LineFillSymbolReader(fillSymbol);
84 }
85 else {
86 logger.debug("The reader for type " +
87 fillSymbol.getClass().toString() +
88 " is not implemented!");
89 return parent; 105 return parent;
90 } 106 }
91 } 107 }
92 else { 108 else {
93 return parent; 109 return parent;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)