/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION) && !getName().startsWith(EXPERIMENTAL_PREFIX)) { throw new ValidationException( "Experimental components must have the following prefix: " + EXPERIMENTAL_PREFIX); } if (recurse) { validateProperties(); } }
/** * @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; }
/** * 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; }
/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION) && !getName().startsWith(EXPERIMENTAL_PREFIX)) { throw new ValidationException( "Experimental components must have the following prefix: " + EXPERIMENTAL_PREFIX); } if (recurse) { validateProperties(); } }
/** * @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} */ public final void validate(final boolean recurse) throws ValidationException { if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION) && !getName().startsWith(EXPERIMENTAL_PREFIX)) { throw new ValidationException( "Experimental components must have the following prefix: " + EXPERIMENTAL_PREFIX); } if (recurse) { validateProperties(); } }
/** * @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} */ public final void validate(final boolean recurse) throws ValidationException { if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION) && !getName().startsWith(EXPERIMENTAL_PREFIX)) { throw new ValidationException( "Experimental components must have the following prefix: " + EXPERIMENTAL_PREFIX); } if (recurse) { validateProperties(); } }
/** * @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} */ public final void validate(final boolean recurse) throws ValidationException { if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION) && !getName().startsWith(EXPERIMENTAL_PREFIX)) { throw new ValidationException( "Experimental components must have the following prefix: " + EXPERIMENTAL_PREFIX); } if (recurse) { validateProperties(); } }
/** * 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; }
/** * 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; }
/** * 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; }
/** * @return */ public static TestSuite suite() { TestSuite suite = new TestSuite(); suite.addTest(new XComponentTest("testIsCalendarComponent", new XComponent("X-TEST"))); suite.addTest(new XComponentTest("testValidation", new XComponent("X-TEST"))); suite.addTest(new XComponentTest("testValidationException", new XComponent("TEST"))); suite.addTest(new XComponentTest("testRelaxedValidation", new XComponent("TEST"))); return suite; } }
@SuppressWarnings("unchecked") public T build() { Component component = null; for (ComponentFactory factory : factories) { if (factory.supports(name)) { if (!subComponents.isEmpty()) { component = factory.createComponent(properties, subComponents); } else { component = factory.createComponent(properties); } } } if (component == null) { 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; } }
@SuppressWarnings("unchecked") public T build() { Component component = null; for (ComponentFactory factory : factories) { if (factory.supports(name)) { if (!subComponents.isEmpty()) { component = factory.createComponent(properties, subComponents); } else { component = factory.createComponent(properties); } } } if (component == null) { 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; } }
component = new XComponent(name, properties); component = new XComponent(name, properties);