35.5.4. Elements에서의 발생 제약 조건

35.5.4.1. 개요

요소 요소의 minOccurs 속성 및 maxOccurs 속성을 사용하여 복잡한 요소에서 특정 요소가 표시되는 횟수를 지정할 수 있습니다.You can specify how many times a specific element in a complex type appears using the element's minOccurs attribute and maxOccurs attribute. 두 속성의 기본값은 1 입니다.

35.5.4.2. minOccurs가 0으로 설정

복잡한 유형의 멤버 요소 minOccurs 속성 중 하나를 0 으로 설정하면 해당 Java 멤버 변수를 구성하는 @XmlElement 주석이 변경됩니다. 필수 속성을 true 로 설정하는 대신 @XmlElement 주석의 필수 속성이 false 로 설정됩니다.

35.5.4.3. mindays가 1보다 큰 값으로 설정

XML 스키마에서는 요소 요소의 minOccurs 속성을 둘 이상의 값으로 설정하여 형식의 인스턴스에서 요소가 두 번 이상 발생하도록 지정할 수 있습니다.In XML Schema you can specify that an element must occur more than once in an instance of the type by setting the element's minOccurs attribute to a value greater than one. 그러나 생성된 Java 클래스는 XML 스키마 제약 조건을 지원하지 않습니다. Apache CXF는 minOccurs 속성이 설정되지 않은 것처럼 지원되는 Java 멤버 변수를 생성합니다.

35.5.4.4. maxOccurs set이 있는 요소

멤버 요소가 복잡한 형식의 인스턴스에 여러 번 표시되도록 하려면 요소의 maxOccurs 속성을 1보다 큰 값으로 설정합니다.When you want a member element to appear multiple times in an instance of a complex type, you set the element's maxOccurs attribute to a value greater than 1. maxOccurs 특성의 값을 unbounded 로 설정하여 멤버 요소가 무제한으로 표시될 수 있음을 지정할 수 있습니다.

코드 생성기는 maxOccurs 특성이 있는 멤버 요소를 값 1보다 큰 값으로 매핑합니다.The code generators map a member element with the maxOccurs attribute set to a value greater than 1 to a Java member variable. 목록의 기본 클래스는 요소의 유형을 Java에 매핑하여 결정됩니다. XML 스키마 기본 유형의 경우 래퍼 클래스는 “래퍼 클래스” 에 설명된 대로 사용됩니다. 예를 들어 멤버 요소가 xsd:int 형식의 경우 생성된 멤버 변수는 List<Integer> 오브젝트입니다.For example, if the member element is of type xsd:int the generated member variable is a List<Integer > object.