private static ValueExtractor instantiateExtractorWithClassForName(MapAttributeConfig config) { try { Class<?> clazz = Class.forName(config.getExtractor()); Object extractor = clazz.newInstance(); if (extractor instanceof ValueExtractor) { return (ValueExtractor) extractor; } else { throw new IllegalArgumentException("Extractor does not extend ValueExtractor class " + config); } } catch (IllegalAccessException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (InstantiationException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } }
public MapAttributeConfig(MapAttributeConfig config) { name = config.getName(); extractor = config.getExtractor(); }
private static ValueExtractor instantiateExtractorWithConfigClassLoader(MapAttributeConfig config, ClassLoader classLoader) { try { Class<?> clazz = classLoader.loadClass(config.getExtractor()); Object extractor = clazz.newInstance(); if (extractor instanceof ValueExtractor) { return (ValueExtractor) extractor; } else { throw new IllegalArgumentException("Extractor does not extend ValueExtractor class " + config); } } catch (IllegalAccessException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (InstantiationException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } }
private static ValueExtractor instantiateExtractorWithConfigClassLoader(MapAttributeConfig config, ClassLoader classLoader) { try { Class<?> clazz = classLoader.loadClass(config.getExtractor()); Object extractor = clazz.newInstance(); if (extractor instanceof ValueExtractor) { return (ValueExtractor) extractor; } else { throw new IllegalArgumentException("Extractor does not extend ValueExtractor class " + config); } } catch (IllegalAccessException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (InstantiationException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } }
private static ValueExtractor instantiateExtractorWithClassForName(MapAttributeConfig config) { try { Class<?> clazz = Class.forName(config.getExtractor()); Object extractor = clazz.newInstance(); if (extractor instanceof ValueExtractor) { return (ValueExtractor) extractor; } else { throw new IllegalArgumentException("Extractor does not extend ValueExtractor class " + config); } } catch (IllegalAccessException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (InstantiationException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Could not initialize extractor " + config, ex); } }
public MapAttributeConfig(MapAttributeConfig config) { name = config.getName(); extractor = config.getExtractor(); }
public static int calculateDataSize(MapAttributeConfig config) { int dataSize = ParameterUtil.calculateDataSize(config.getName()); dataSize += ParameterUtil.calculateDataSize(config.getExtractor()); return dataSize; } }
public static int calculateDataSize(MapAttributeConfig config) { int dataSize = ParameterUtil.calculateDataSize(config.getName()); dataSize += ParameterUtil.calculateDataSize(config.getExtractor()); return dataSize; } }
public static int calculateDataSize(MapAttributeConfig config) { int dataSize = ParameterUtil.calculateDataSize(config.getName()); dataSize += ParameterUtil.calculateDataSize(config.getExtractor()); return dataSize; } }
public static void encode(MapAttributeConfig config, ClientMessage clientMessage) { clientMessage.set(config.getName()).set(config.getExtractor()); }
public static void encode(MapAttributeConfig config, ClientMessage clientMessage) { clientMessage.set(config.getName()).set(config.getExtractor()); }
public static void encode(MapAttributeConfig config, ClientMessage clientMessage) { clientMessage.set(config.getName()).set(config.getExtractor()); }
private static void mapAttributeConfigXmlGenerator(XmlGenerator gen, MapConfig m) { if (!m.getMapAttributeConfigs().isEmpty()) { gen.open("attributes"); for (MapAttributeConfig attributeCfg : m.getMapAttributeConfigs()) { gen.node("attribute", attributeCfg.getName(), "extractor", attributeCfg.getExtractor()); } gen.close(); } }
private static void mapAttributeConfigXmlGenerator(XmlGenerator gen, MapConfig m) { if (!m.getMapAttributeConfigs().isEmpty()) { gen.open("attributes"); for (MapAttributeConfig attributeCfg : m.getMapAttributeConfigs()) { gen.node("attribute", attributeCfg.getName(), "extractor", attributeCfg.getExtractor()); } gen.close(); } }