/** * {@inheritDoc} */ public void startComponent(final String name) { if (component != null) { subComponent = componentFactory.createComponent(name); } else { component = componentFactory.createComponent(name); } }
/** * @param parser a custom calendar parser * @param propertyFactoryRegistry registry for non-standard property factories * @param parameterFactoryRegistry registry for non-standard parameter factories * @param tzRegistry a custom timezone registry */ public CalendarBuilder(CalendarParser parser, PropertyFactoryRegistry propertyFactoryRegistry, ParameterFactoryRegistry parameterFactoryRegistry, TimeZoneRegistry tzRegistry) { this.parser = parser; this.tzRegistry = tzRegistry; this.contentHandler = new ContentHandlerImpl(new ComponentFactoryImpl(), propertyFactoryRegistry, parameterFactoryRegistry); }
public ContentHandlerImpl(final PropertyFactoryRegistry propertyFactory, final ParameterFactoryRegistry parameterFactory) { this.componentFactory = ComponentFactoryImpl.getInstance(); this.propertyFactory = propertyFactory; this.parameterFactory = parameterFactory; }
/** * @param name a component name * @return a new component instance of the specified type */ public <T extends Component> T createComponent(final String name) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(); } else if (isExperimentalName(name)) { component = new XComponent(name); } else if (allowIllegalNames()) { component = new XComponent(name); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * Create a (deep) copy of this component. * * @return the component copy * @throws IOException where an error occurs reading the component data * @throws ParseException where parsing component data fails * @throws URISyntaxException where component data contains an invalid URI */ public Component copy() throws ParseException, IOException, URISyntaxException { // Deep copy properties.. final PropertyList<Property> newprops = new PropertyList<Property>(getProperties()); return new ComponentFactoryImpl().createComponent(getName(), newprops); }
/** * Create a (deep) copy of this component. * * @return the component copy * @throws IOException where an error occurs reading the component data * @throws ParseException where parsing component data fails * @throws URISyntaxException where component data contains an invalid URI */ public Component copy() throws ParseException, IOException, URISyntaxException { // Deep copy properties.. final PropertyList newprops = new PropertyList(getProperties()); return ComponentFactoryImpl.getInstance().createComponent(getName(), newprops); }
/** * Creates a component which contains sub-components. Currently the only such component is VTIMEZONE. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ @SuppressWarnings("unchecked") public <T extends Component> T createComponent(final String name, final PropertyList properties, final ComponentList<? extends Component> components) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(properties, components); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * @param name a component name * @return a new component instance of the specified type */ public <T extends Component> T createComponent(final String name) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(); } else if (isExperimentalName(name)) { component = new XComponent(name); } else if (allowIllegalNames()) { component = new XComponent(name); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * Create a (deep) copy of this component. * * @return the component copy * @throws IOException where an error occurs reading the component data * @throws ParseException where parsing component data fails * @throws URISyntaxException where component data contains an invalid URI */ public Component copy() throws ParseException, IOException, URISyntaxException { // Deep copy properties.. final PropertyList<Property> newprops = new PropertyList<Property>(getProperties()); return new ComponentFactoryImpl().createComponent(getName(), newprops); }
/** * Creates a component which contains sub-components. Currently the only such component is VTIMEZONE. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ @SuppressWarnings("unchecked") public <T extends Component> T createComponent(final String name, final PropertyList properties, final ComponentList<? extends Component> components) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(properties, components); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * @param name a component name * @return a new component instance of the specified type */ public <T extends Component> T createComponent(final String name) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(); } else if (isExperimentalName(name)) { component = new XComponent(name); } else if (allowIllegalNames()) { component = new XComponent(name); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * Create a (deep) copy of this component. * * @return the component copy * @throws IOException where an error occurs reading the component data * @throws ParseException where parsing component data fails * @throws URISyntaxException where component data contains an invalid URI */ public Component copy() throws ParseException, IOException, URISyntaxException { // Deep copy properties.. final PropertyList<Property> newprops = new PropertyList<Property>(getProperties()); return new ComponentFactoryImpl().createComponent(getName(), newprops); }
/** * {@inheritDoc} */ public void startComponent(final String name) { CalendarBuilder.this.startComponent(componentFactory.createComponent(name)); }
/** * Creates a component which contains sub-components. Currently the only such component is VTIMEZONE. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ @SuppressWarnings("unchecked") public <T extends Component> T createComponent(final String name, final PropertyList properties, final ComponentList<? extends Component> components) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(properties, components); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * @param parser a custom calendar parser * @param propertyFactoryRegistry registry for non-standard property factories * @param parameterFactoryRegistry registry for non-standard parameter factories * @param tzRegistry a custom timezone registry */ public CalendarBuilder(CalendarParser parser, PropertyFactoryRegistry propertyFactoryRegistry, ParameterFactoryRegistry parameterFactoryRegistry, TimeZoneRegistry tzRegistry) { this.parser = parser; this.tzRegistry = tzRegistry; this.contentHandler = new ContentHandlerImpl(ComponentFactoryImpl.getInstance(), propertyFactoryRegistry, parameterFactoryRegistry); }
/** * @param name a component name * @return a new component instance of the specified type */ public <T extends Component> T createComponent(final String name) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(); } else if (isExperimentalName(name)) { component = new XComponent(name); } else if (allowIllegalNames()) { component = new XComponent(name); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * {@inheritDoc} */ @Override public void startComponent(final String name) { bs.startComponent(componentFactory.createComponent(name)); }
/** * Creates a component which contains sub-components. Currently the only such component is VTIMEZONE. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ @SuppressWarnings("unchecked") public <T extends Component> T createComponent(final String name, final PropertyList properties, final ComponentList<? extends Component> components) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(properties, components); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }
/** * @param bs the state */ public ContentHandlerImpl(final BuildState bs) { this.bs = bs; componentFactory = ComponentFactoryImpl.getInstance(); propertyFactory = new PropertyFactoryRegistry(); parameterFactory = new ParameterFactoryRegistry(); }
/** * Creates a component. * * @param name name of the component * @param properties a list of component properties * @return a component */ @SuppressWarnings("unchecked") public <T extends Component> T createComponent(final String name, final PropertyList properties) { Component component; ComponentFactory factory = getFactory(name); if (factory != null) { component = factory.createComponent(properties); } else if (isExperimentalName(name)) { component = new XComponent(name, properties); } else if (allowIllegalNames()) { component = new XComponent(name, properties); } else { throw new IllegalArgumentException("Unsupported component [" + name + "]"); } return (T) component; }