1 27 28 package org.objectweb.speedo.metadata; 29 30 import java.util.ArrayList ; 31 import java.util.List ; 32 33 37 public abstract class SpeedoElement { 38 41 public List jdoExtension = new ArrayList (); 42 43 public String getExtensionValueByKey(String key) { 44 SpeedoExtension se = getExtensionByKey(key); 45 return (se == null ? null : se.value); 46 } 47 48 public SpeedoExtension getExtensionByKey(String key) { 49 if (jdoExtension == null || key == null) { 50 return null; 51 } 52 for(int i=0; i<jdoExtension.size(); i++) { 53 SpeedoExtension se = (SpeedoExtension) jdoExtension.get(i); 54 if (key.equals(se.key)) { 55 return se; 56 } 57 } 58 return null; 59 } 60 public SpeedoExtension getExtension(String vendor, String key) { 61 if (jdoExtension == null || vendor == null || key == null) { 62 return null; 63 } 64 for(int i=0; i<jdoExtension.size(); i++) { 65 SpeedoExtension se = (SpeedoExtension) jdoExtension.get(i); 66 if (vendor.equals(se.vendorName) && key.equals(se.key)) { 67 return se; 68 } 69 } 70 return null; 71 } 72 73 public void addExtension(SpeedoExtension se) { 74 jdoExtension.add(se); 75 } 76 } 77 | Popular Tags |