private PrismPropertyDefinition<?> createAdHocPropertyDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs) { PrismPropertyDefinitionImpl<?> def = new PrismPropertyDefinitionImpl<>(elementName, typeName, prismContext); def.setMinOccurs(minOccurs); def.setMaxOccurs(maxOccurs); return def; }
public static ItemDefinition createDefaultItemDefinition(QName itemName, PrismContext prismContext) { PrismPropertyDefinitionImpl propDef = new PrismPropertyDefinitionImpl(itemName, DEFAULT_XSD_TYPE, prismContext); // Set it to multi-value to be on the safe side propDef.setMaxOccurs(-1); propDef.setDynamic(true); return propDef; }
/** * Creates new instance of property definition and adds it to the container. * <p> * This is the preferred method of creating a new definition. * * @param localName name of the property (element name) relative to the schema namespace * @param localTypeName XSD type of the property * @param minOccurs minimal number of occurrences * @param maxOccurs maximal number of occurrences (-1 means unbounded) * @return created property definition */ public PrismPropertyDefinition createPropertyDefinition(String localName, String localTypeName, int minOccurs, int maxOccurs) { QName name = new QName(getSchemaNamespace(), localName); QName typeName = new QName(getSchemaNamespace(), localTypeName); PrismPropertyDefinitionImpl propertyDefinition = createPropertyDefinition(name, typeName); propertyDefinition.setMinOccurs(minOccurs); propertyDefinition.setMaxOccurs(maxOccurs); return propertyDefinition; }
propDef.setMaxOccurs(maxOccurs); propDef.setDynamic(true); return propDef;
/** * Creates new instance of property definition and adds it to the container. * <p> * This is the preferred method of creating a new definition. * * @param name name of the property (element name) * @param typeName XSD type of the property * @param minOccurs minimal number of occurrences * @param maxOccurs maximal number of occurrences (-1 means unbounded) * @return created property definition */ public MutablePrismPropertyDefinition<?> createPropertyDefinition(QName name, QName typeName, int minOccurs, int maxOccurs) { PrismPropertyDefinitionImpl propDef = new PrismPropertyDefinitionImpl(name, typeName, prismContext); propDef.setMinOccurs(minOccurs); propDef.setMaxOccurs(maxOccurs); addDefinition(propDef); return propDef; }
Integer maxOccurs = node.getMaxOccurs(); if (maxOccurs != null) { propDef.setMaxOccurs(maxOccurs); } else { propDef.setMaxOccurs(-1);
throw new IllegalStateException("No identifier for complex type " + this); oidDefinition.setMaxOccurs(1);