/** * Get a list {@link Object}s from the supplied {@link org.milyn.cdr.SmooksResourceConfiguration} selector value. * <p/> * Uses {@link org.milyn.cdr.SmooksResourceConfigurationStore#getObject(org.milyn.cdr.SmooksResourceConfiguration)} to construct the object. * @param selector selector attribute value from the .cdrl file in the .cdrar. * @return List of Object instances. An empty list is returned where no * selectors exist. */ public List getObjects(String selector) { Vector objects; objects = (Vector)objectsTable.get(selector); if(objects == null) { List unitDefs = resourceConfigTable.get(selector); if(unitDefs != null && unitDefs.size() > 0) { objects = new Vector(unitDefs.size()); if(applicationContext == null) { throw new IllegalStateException("Call to getObjects() before the setApplicationContext() was called."); } for (final Object unitDef : unitDefs) { SmooksResourceConfiguration resConfig = (SmooksResourceConfiguration) unitDef; objects.add(applicationContext.getStore().getObject(resConfig)); } } else { objects = EMPTY_LIST; } objectsTable.put(selector, objects); } return objects; }
/** * Get a list {@link Object}s from the supplied {@link org.milyn.cdr.SmooksResourceConfiguration} selector value. * * Uses {@link org.milyn.cdr.SmooksResourceConfigurationStore#getObject(org.milyn.cdr.SmooksResourceConfiguration)} to construct the object. * @param selector selector attribute value from the .cdrl file in the .cdrar. * @return List of Object instances. An empty list is returned where no * selectors exist. */ public List getObjects(String selector) { Vector objects; objects = (Vector)objectsTable.get(selector); if(objects == null) { List unitDefs = resourceConfigTable.get(selector); if(unitDefs != null && unitDefs.size() > 0) { objects = new Vector(unitDefs.size()); if(applicationContext == null) { throw new IllegalStateException("Call to getObjects() before the setApplicationContext() was called."); } for(int i = 0; i < unitDefs.size(); i++) { SmooksResourceConfiguration resConfig = (SmooksResourceConfiguration)unitDefs.get(i); objects.add(applicationContext.getStore().getObject(resConfig)); } } else { objects = EMPTY_LIST; } objectsTable.put(selector, objects); } return objects; }
/** * Get a list {@link Object}s from the supplied {@link org.milyn.cdr.SmooksResourceConfiguration} selector value. * <p/> * Uses {@link org.milyn.cdr.SmooksResourceConfigurationStore#getObject(org.milyn.cdr.SmooksResourceConfiguration)} to construct the object. * @param selector selector attribute value from the .cdrl file in the .cdrar. * @return List of Object instances. An empty list is returned where no * selectors exist. */ public List getObjects(String selector) { Vector objects; objects = (Vector)objectsTable.get(selector); if(objects == null) { List unitDefs = resourceConfigTable.get(selector); if(unitDefs != null && unitDefs.size() > 0) { objects = new Vector(unitDefs.size()); if(applicationContext == null) { throw new IllegalStateException("Call to getObjects() before the setApplicationContext() was called."); } for (final Object unitDef : unitDefs) { SmooksResourceConfiguration resConfig = (SmooksResourceConfiguration) unitDef; objects.add(applicationContext.getStore().getObject(resConfig)); } } else { objects = EMPTY_LIST; } objectsTable.put(selector, objects); } return objects; }
/** * Get a list {@link Object}s from the supplied {@link org.milyn.cdr.SmooksResourceConfiguration} selector value. * <p/> * Uses {@link org.milyn.cdr.SmooksResourceConfigurationStore#getObject(org.milyn.cdr.SmooksResourceConfiguration)} to construct the object. * @param selector selector attribute value from the .cdrl file in the .cdrar. * @return List of Object instances. An empty list is returned where no * selectors exist. */ public List getObjects(String selector) { Vector objects; objects = (Vector)objectsTable.get(selector); if(objects == null) { List unitDefs = resourceConfigTable.get(selector); if(unitDefs != null && unitDefs.size() > 0) { objects = new Vector(unitDefs.size()); if(applicationContext == null) { throw new IllegalStateException("Call to getObjects() before the setApplicationContext() was called."); } for (final Object unitDef : unitDefs) { SmooksResourceConfiguration resConfig = (SmooksResourceConfiguration) unitDef; objects.add(applicationContext.getStore().getObject(resConfig)); } } else { objects = EMPTY_LIST; } objectsTable.put(selector, objects); } return objects; }
/** * Get the {@link org.milyn.delivery.ContentHandlerFactory} for a resource based on the * supplied resource type. * * Note that {@link org.milyn.delivery.ContentHandlerFactory} implementations must be configured under a selector value of "cdu-creator". * @param type {@link org.milyn.delivery.ContentHandlerFactory} type e.g. "class", "xsl" etc. * @return {@link org.milyn.delivery.ContentHandlerFactory} for the resource. * @throws org.milyn.delivery.UnsupportedContentHandlerTypeException No {@link org.milyn.delivery.ContentHandlerFactory} * registered for the specified resource type. */ public ContentHandlerFactory getContentHandlerFactory(String type) throws UnsupportedContentHandlerTypeException { if(type == null) { throw new IllegalArgumentException("null 'resourceExtension' arg in method call."); } for(int i = 0; i < configLists.size(); i++) { SmooksResourceConfigurationList list = configLists.get(i); for(int ii = 0; ii < list.size(); ii++) { SmooksResourceConfiguration config = list.get(ii); String selector = config.getSelector(); if(CDU_CREATOR.equals(selector) && type.equalsIgnoreCase(config.getStringParameter(ContentHandlerFactory.PARAM_RESTYPE))) { return (ContentHandlerFactory) getObject(config); } } } throw new UnsupportedContentHandlerTypeException(type); }
/** * Get the {@link org.milyn.delivery.ContentHandlerFactory} for a resource based on the * supplied resource type. * <p/> * Note that {@link org.milyn.delivery.ContentHandlerFactory} implementations must be configured under a selector value of "cdu-creator". * @param type {@link org.milyn.delivery.ContentHandlerFactory} type e.g. "class", "xsl" etc. * @return {@link org.milyn.delivery.ContentHandlerFactory} for the resource. * @throws org.milyn.delivery.UnsupportedContentHandlerTypeException No {@link org.milyn.delivery.ContentHandlerFactory} * registered for the specified resource type. */ public ContentHandlerFactory getContentHandlerFactory(String type) throws UnsupportedContentHandlerTypeException { if(type == null) { throw new IllegalArgumentException("null 'resourceExtension' arg in method call."); } for (final SmooksResourceConfigurationList list : configLists) { for (int ii = 0; ii < list.size(); ii++) { SmooksResourceConfiguration config = list.get(ii); String selector = config.getSelector(); if (CDU_CREATOR.equals(selector) && type.equalsIgnoreCase(config.getStringParameter(ContentHandlerFactory.PARAM_RESTYPE))) { return (ContentHandlerFactory) getObject(config); } } } throw new UnsupportedContentHandlerTypeException(type); }
/** * Get the {@link org.milyn.delivery.ContentHandlerFactory} for a resource based on the * supplied resource type. * <p/> * Note that {@link org.milyn.delivery.ContentHandlerFactory} implementations must be configured under a selector value of "cdu-creator". * @param type {@link org.milyn.delivery.ContentHandlerFactory} type e.g. "class", "xsl" etc. * @return {@link org.milyn.delivery.ContentHandlerFactory} for the resource. * @throws org.milyn.delivery.UnsupportedContentHandlerTypeException No {@link org.milyn.delivery.ContentHandlerFactory} * registered for the specified resource type. */ public ContentHandlerFactory getContentHandlerFactory(String type) throws UnsupportedContentHandlerTypeException { if(type == null) { throw new IllegalArgumentException("null 'resourceExtension' arg in method call."); } for (final SmooksResourceConfigurationList list : configLists) { for (int ii = 0; ii < list.size(); ii++) { SmooksResourceConfiguration config = list.get(ii); String selector = config.getSelector(); if (CDU_CREATOR.equals(selector) && type.equalsIgnoreCase(config.getStringParameter(ContentHandlerFactory.PARAM_RESTYPE))) { return (ContentHandlerFactory) getObject(config); } } } throw new UnsupportedContentHandlerTypeException(type); }
/** * Get the {@link org.milyn.delivery.ContentHandlerFactory} for a resource based on the * supplied resource type. * <p/> * Note that {@link org.milyn.delivery.ContentHandlerFactory} implementations must be configured under a selector value of "cdu-creator". * @param type {@link org.milyn.delivery.ContentHandlerFactory} type e.g. "class", "xsl" etc. * @return {@link org.milyn.delivery.ContentHandlerFactory} for the resource. * @throws org.milyn.delivery.UnsupportedContentHandlerTypeException No {@link org.milyn.delivery.ContentHandlerFactory} * registered for the specified resource type. */ public ContentHandlerFactory getContentHandlerFactory(String type) throws UnsupportedContentHandlerTypeException { if(type == null) { throw new IllegalArgumentException("null 'resourceExtension' arg in method call."); } for (final SmooksResourceConfigurationList list : configLists) { for (int ii = 0; ii < list.size(); ii++) { SmooksResourceConfiguration config = list.get(ii); String selector = config.getSelector(); if (CDU_CREATOR.equals(selector) && type.equalsIgnoreCase(config.getStringParameter(ContentHandlerFactory.PARAM_RESTYPE))) { return (ContentHandlerFactory) getObject(config); } } } throw new UnsupportedContentHandlerTypeException(type); }