public PortletDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>PortletDescriptor</code> */ public PortletDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"); return this; }
/** * If not already created, a new <code>listener</code> element will be created and returned. * Otherwise, the first existing <code>listener</code> element will be returned. * @return the instance defined for the element <code>listener</code> */ public ListenerType<PortletDescriptor> getOrCreateListener() { List<Node> nodeList = model.get("listener"); if (nodeList != null && nodeList.size() > 0) { return new ListenerTypeImpl<PortletDescriptor>(this, "listener", model, nodeList.get(0)); } return createListener(); }
/** * If not already created, a new <code>portlet</code> element will be created and returned. * Otherwise, the first existing <code>portlet</code> element will be returned. * @return the instance defined for the element <code>portlet</code> */ public PortletType<PortletDescriptor> getOrCreatePortlet() { List<Node> nodeList = model.get("portlet"); if (nodeList != null && nodeList.size() > 0) { return new PortletTypeImpl<PortletDescriptor>(this, "portlet", model, nodeList.get(0)); } return createPortlet(); }
/** * If not already created, a new <code>custom-window-state</code> element will be created and returned. * Otherwise, the first existing <code>custom-window-state</code> element will be returned. * @return the instance defined for the element <code>custom-window-state</code> */ public CustomWindowStateType<PortletDescriptor> getOrCreateCustomWindowState() { List<Node> nodeList = model.get("custom-window-state"); if (nodeList != null && nodeList.size() > 0) { return new CustomWindowStateTypeImpl<PortletDescriptor>(this, "custom-window-state", model, nodeList.get(0)); } return createCustomWindowState(); }
/** * If not already created, a new <code>filter</code> element will be created and returned. * Otherwise, the first existing <code>filter</code> element will be returned. * @return the instance defined for the element <code>filter</code> */ public FilterType<PortletDescriptor> getOrCreateFilter() { List<Node> nodeList = model.get("filter"); if (nodeList != null && nodeList.size() > 0) { return new FilterTypeImpl<PortletDescriptor>(this, "filter", model, nodeList.get(0)); } return createFilter(); }
/** * If not already created, a new <code>custom-portlet-mode</code> element will be created and returned. * Otherwise, the first existing <code>custom-portlet-mode</code> element will be returned. * @return the instance defined for the element <code>custom-portlet-mode</code> */ public CustomPortletModeType<PortletDescriptor> getOrCreateCustomPortletMode() { List<Node> nodeList = model.get("custom-portlet-mode"); if (nodeList != null && nodeList.size() > 0) { return new CustomPortletModeTypeImpl<PortletDescriptor>(this, "custom-portlet-mode", model, nodeList.get(0)); } return createCustomPortletMode(); }
/** * If not already created, a new <code>filter-mapping</code> element will be created and returned. * Otherwise, the first existing <code>filter-mapping</code> element will be returned. * @return the instance defined for the element <code>filter-mapping</code> */ public FilterMappingType<PortletDescriptor> getOrCreateFilterMapping() { List<Node> nodeList = model.get("filter-mapping"); if (nodeList != null && nodeList.size() > 0) { return new FilterMappingTypeImpl<PortletDescriptor>(this, "filter-mapping", model, nodeList.get(0)); } return createFilterMapping(); }
/** * If not already created, a new <code>event-definition</code> element will be created and returned. * Otherwise, the first existing <code>event-definition</code> element will be returned. * @return the instance defined for the element <code>event-definition</code> */ public EventDefinitionType<PortletDescriptor> getOrCreateEventDefinition() { List<Node> nodeList = model.get("event-definition"); if (nodeList != null && nodeList.size() > 0) { return new EventDefinitionTypeImpl<PortletDescriptor>(this, "event-definition", model, nodeList.get(0)); } return createEventDefinition(); }
/** * If not already created, a new <code>container-runtime-option</code> element will be created and returned. * Otherwise, the first existing <code>container-runtime-option</code> element will be returned. * @return the instance defined for the element <code>container-runtime-option</code> */ public ContainerRuntimeOptionType<PortletDescriptor> getOrCreateContainerRuntimeOption() { List<Node> nodeList = model.get("container-runtime-option"); if (nodeList != null && nodeList.size() > 0) { return new ContainerRuntimeOptionTypeImpl<PortletDescriptor>(this, "container-runtime-option", model, nodeList.get(0)); } return createContainerRuntimeOption(); }
/** * If not already created, a new <code>listener</code> element will be created and returned. * Otherwise, the first existing <code>listener</code> element will be returned. * @return the instance defined for the element <code>listener</code> */ public ListenerType<PortletDescriptor> getOrCreateListener() { List<Node> nodeList = model.get("listener"); if (nodeList != null && nodeList.size() > 0) { return new ListenerTypeImpl<PortletDescriptor>(this, "listener", model, nodeList.get(0)); } return createListener(); }
/** * If not already created, a new <code>portlet</code> element will be created and returned. * Otherwise, the first existing <code>portlet</code> element will be returned. * @return the instance defined for the element <code>portlet</code> */ public PortletType<PortletDescriptor> getOrCreatePortlet() { List<Node> nodeList = model.get("portlet"); if (nodeList != null && nodeList.size() > 0) { return new PortletTypeImpl<PortletDescriptor>(this, "portlet", model, nodeList.get(0)); } return createPortlet(); }
/** * If not already created, a new <code>custom-window-state</code> element will be created and returned. * Otherwise, the first existing <code>custom-window-state</code> element will be returned. * @return the instance defined for the element <code>custom-window-state</code> */ public CustomWindowStateType<PortletDescriptor> getOrCreateCustomWindowState() { List<Node> nodeList = model.get("custom-window-state"); if (nodeList != null && nodeList.size() > 0) { return new CustomWindowStateTypeImpl<PortletDescriptor>(this, "custom-window-state", model, nodeList.get(0)); } return createCustomWindowState(); }
/** * If not already created, a new <code>filter</code> element will be created and returned. * Otherwise, the first existing <code>filter</code> element will be returned. * @return the instance defined for the element <code>filter</code> */ public FilterType<PortletDescriptor> getOrCreateFilter() { List<Node> nodeList = model.get("filter"); if (nodeList != null && nodeList.size() > 0) { return new FilterTypeImpl<PortletDescriptor>(this, "filter", model, nodeList.get(0)); } return createFilter(); }
/** * If not already created, a new <code>custom-portlet-mode</code> element will be created and returned. * Otherwise, the first existing <code>custom-portlet-mode</code> element will be returned. * @return the instance defined for the element <code>custom-portlet-mode</code> */ public CustomPortletModeType<PortletDescriptor> getOrCreateCustomPortletMode() { List<Node> nodeList = model.get("custom-portlet-mode"); if (nodeList != null && nodeList.size() > 0) { return new CustomPortletModeTypeImpl<PortletDescriptor>(this, "custom-portlet-mode", model, nodeList.get(0)); } return createCustomPortletMode(); }
/** * If not already created, a new <code>filter-mapping</code> element will be created and returned. * Otherwise, the first existing <code>filter-mapping</code> element will be returned. * @return the instance defined for the element <code>filter-mapping</code> */ public FilterMappingType<PortletDescriptor> getOrCreateFilterMapping() { List<Node> nodeList = model.get("filter-mapping"); if (nodeList != null && nodeList.size() > 0) { return new FilterMappingTypeImpl<PortletDescriptor>(this, "filter-mapping", model, nodeList.get(0)); } return createFilterMapping(); }
/** * If not already created, a new <code>event-definition</code> element will be created and returned. * Otherwise, the first existing <code>event-definition</code> element will be returned. * @return the instance defined for the element <code>event-definition</code> */ public EventDefinitionType<PortletDescriptor> getOrCreateEventDefinition() { List<Node> nodeList = model.get("event-definition"); if (nodeList != null && nodeList.size() > 0) { return new EventDefinitionTypeImpl<PortletDescriptor>(this, "event-definition", model, nodeList.get(0)); } return createEventDefinition(); }
/** * If not already created, a new <code>container-runtime-option</code> element will be created and returned. * Otherwise, the first existing <code>container-runtime-option</code> element will be returned. * @return the instance defined for the element <code>container-runtime-option</code> */ public ContainerRuntimeOptionType<PortletDescriptor> getOrCreateContainerRuntimeOption() { List<Node> nodeList = model.get("container-runtime-option"); if (nodeList != null && nodeList.size() > 0) { return new ContainerRuntimeOptionTypeImpl<PortletDescriptor>(this, "container-runtime-option", model, nodeList.get(0)); } return createContainerRuntimeOption(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>PortletDescriptor</code> */ public PortletDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"); return this; }
public PortletDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }