@@ -124,32 +124,33 @@ public class MetaDataObject {
124124
125125 public MDObjectBase getPropertyByType (MDOType type ) {
126126
127- if (type == MDOType .CONFIGURATION ) {
128- return getConfiguration ();
129- } else if (type == MDOType .ENUM ) {
130- return get_enum ();
131- } else if (type == MDOType .INTERFACE ) {
132- return get_interface ();
133- } else if (type == MDOType .HTTP_SERVICE ) {
134- return getHttpService ();
135- } else if (type == MDOType .WEB_SERVICE ) {
136- return getWebService ();
137- } else if (type == MDOType .WS_REFERENCE ) {
138- return getWsReference ();
139- } else if (type == MDOType .XDTO_PACKAGE ) {
140- return getXdtoPackage ();
141- } else {
142- String propertyName = type .getShortClassName ();
143- try {
144- return (MDObjectBase ) getClass ()
145- .getDeclaredField (
146- propertyName .substring (0 , 1 ).toLowerCase () + propertyName .substring (1 ))
147- .get (this );
148- } catch (IllegalAccessException | NoSuchFieldException e ) {
149- LOGGER .error ("Can't find property for name" , e );
150- }
127+ switch (type ) {
128+ case CONFIGURATION :
129+ return getConfiguration ();
130+ case ENUM :
131+ return get_enum ();
132+ case INTERFACE :
133+ return get_interface ();
134+ case HTTP_SERVICE :
135+ return getHttpService ();
136+ case WEB_SERVICE :
137+ return getWebService ();
138+ case WS_REFERENCE :
139+ return getWsReference ();
140+ case XDTO_PACKAGE :
141+ return getXdtoPackage ();
142+ default :
143+ String propertyName = type .getShortClassName ();
144+ try {
145+ return (MDObjectBase ) getClass ()
146+ .getDeclaredField (
147+ propertyName .substring (0 , 1 ).toLowerCase () + propertyName .substring (1 ))
148+ .get (this );
149+ } catch (IllegalAccessException | NoSuchFieldException e ) {
150+ LOGGER .error ("Can't find property for name" , e );
151+ }
151152
152- return null ;
153+ return null ;
153154 }
154155 }
155156}
0 commit comments