public ValidationMappingDescriptorImpl(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>ValidationMappingDescriptor</code> */ public ValidationMappingDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.1.xsd"); addNamespace("xmlns", "http://jboss.org/xml/ns/javax/validation/mapping"); return this; }
/** * If not already created, a new <code>constraint-definition</code> element will be created and returned. * Otherwise, the first existing <code>constraint-definition</code> element will be returned. * @return the instance defined for the element <code>constraint-definition</code> */ public ConstraintDefinitionType<ValidationMappingDescriptor> getOrCreateConstraintDefinition() { List<Node> nodeList = model.get("constraint-definition"); if (nodeList != null && nodeList.size() > 0) { return new ConstraintDefinitionTypeImpl<ValidationMappingDescriptor>(this, "constraint-definition", model, nodeList.get(0)); } return createConstraintDefinition(); }
/** * If not already created, a new <code>bean</code> element will be created and returned. * Otherwise, the first existing <code>bean</code> element will be returned. * @return the instance defined for the element <code>bean</code> */ public BeanType<ValidationMappingDescriptor> getOrCreateBean() { List<Node> nodeList = model.get("bean"); if (nodeList != null && nodeList.size() > 0) { return new BeanTypeImpl<ValidationMappingDescriptor>(this, "bean", model, nodeList.get(0)); } return createBean(); }
/** * If not already created, a new <code>constraint-definition</code> element will be created and returned. * Otherwise, the first existing <code>constraint-definition</code> element will be returned. * @return the instance defined for the element <code>constraint-definition</code> */ public ConstraintDefinitionType<ValidationMappingDescriptor> getOrCreateConstraintDefinition() { List<Node> nodeList = model.get("constraint-definition"); if (nodeList != null && nodeList.size() > 0) { return new ConstraintDefinitionTypeImpl<ValidationMappingDescriptor>(this, "constraint-definition", model, nodeList.get(0)); } return createConstraintDefinition(); }
/** * If not already created, a new <code>bean</code> element will be created and returned. * Otherwise, the first existing <code>bean</code> element will be returned. * @return the instance defined for the element <code>bean</code> */ public BeanType<ValidationMappingDescriptor> getOrCreateBean() { List<Node> nodeList = model.get("bean"); if (nodeList != null && nodeList.size() > 0) { return new BeanTypeImpl<ValidationMappingDescriptor>(this, "bean", model, nodeList.get(0)); } return createBean(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>ValidationMappingDescriptor</code> */ public ValidationMappingDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.1.xsd"); addNamespace("xmlns", "http://jboss.org/xml/ns/javax/validation/mapping"); return this; }
public ValidationMappingDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }