ValidatorBean extends ElementBeanBase<ValidatorBean.ValidatorExtension> { public void setTargetClass(ClassName validatorClass) { this.targetClass = validatorClass; }  @XmlElement(name = "validator-id", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE) FacesId getId(); void setId(FacesId id); @Override @XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class) @XmlJavaTypeAdapter(PropertyAdapter.class) Collection<PropertyModel> getProperties(); @Override @XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class) @XmlJavaTypeAdapter(AttributeAdapter.class) Collection<AttributeModel> getFacesAttributes(); @XmlElement(name = "validator-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE) ClassName getTargetClass(); void setTargetClass(ClassName validatorClass); @Override @XmlElement(name = "validator-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE) ValidatorExtension getExtension(); @Override void setExtension(ValidatorExtension extension);  }
@Test public void testMarshal() throws Exception { ComponentLibrary library = new ComponentLibrary(); ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId("my_validator")); validatorModel.setTargetClass(ClassName.parseName(Object.class.getName())); library.getValidators().add(validatorModel); StringWriter facesConfig = generateFacesConfig(library); checkXmlStructure(facesConfig); validateXml(facesConfig); }