1 /*
2 * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0, which is available at
6 * http://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package com.sun.xml.bind.v2.model.core;
12
13 import javax.xml.bind.annotation.XmlMimeType;
14 import javax.xml.bind.annotation.XmlType;
15 import javax.xml.bind.annotation.XmlInlineBinaryData;
16
17 /**
18 * An Enum that indicates if the property is
19 * Element, ElementRef, Value, or Attribute.
20 *
21 * <p>
22 * Corresponds to the four different kind of {@link PropertyInfo}.
23 * @author Bhakti Mehta (bhakti.mehta@sun.com)
24 */
25 public enum PropertyKind {
26 VALUE(true,false,Integer.MAX_VALUE),
27 ATTRIBUTE(false,false,Integer.MAX_VALUE),
28 ELEMENT(true,true,0),
29 REFERENCE(false,true,1),
30 MAP(false,true,2),
31 ;
32
33 /**
34 * This kind of property can have {@link XmlMimeType} and {@link XmlInlineBinaryData}
35 * annotation with it.
36 */
37 public final boolean canHaveXmlMimeType;
38
39 /**
40 * This kind of properties need to show up in {@link XmlType#propOrder()}.
41 */
42 public final boolean isOrdered;
43
44 /**
45 * {@code com.sun.xml.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
46 * {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order.
47 */
48 public final int propertyIndex;
49
50 PropertyKind(boolean canHaveExpectedContentType, boolean isOrdered, int propertyIndex) {
51 this.canHaveXmlMimeType = canHaveExpectedContentType;
52 this.isOrdered = isOrdered;
53 this.propertyIndex = propertyIndex;
54 }
55 }
56