001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.marshall.soap; 018 019import static org.apache.juneau.commons.utils.Shorts.*; 020 021import org.apache.juneau.commons.*; 022 023/** 024 * Utility classes and methods for the {@link SoapXml @SoapXml} annotation. 025 * 026 */ 027public class SoapXmlAnnotation { 028 029 /** 030 * Prevents instantiation. 031 */ 032 private SoapXmlAnnotation() {} 033 034 /** 035 * Builder class. 036 */ 037 public static class Builder extends AnnotationObject.Builder { 038 039 private String[] description = {}; 040 041 /** 042 * Constructor. 043 */ 044 protected Builder() { 045 super(SoapXml.class); 046 } 047 048 /** 049 * Instantiates a new {@link SoapXml @SoapXml} object initialized with this builder. 050 * 051 * @return A new {@link SoapXml @SoapXml} object. 052 */ 053 public SoapXml build() { 054 return new Object(this); 055 } 056 057 /** 058 * Sets the description property. 059 * 060 * @param value The new value. 061 * @return This object. 062 */ 063 public Builder description(String...value) { 064 description = value; 065 return this; 066 } 067 068 } 069 070 @SuppressWarnings({ 071 "java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods 072 }) 073 private static class Object extends AnnotationObject implements SoapXml { 074 075 private final String[] description; 076 077 Object(SoapXmlAnnotation.Builder b) { 078 super(b); 079 this.description = cp(b.description); 080 } 081 082 @Override 083 public String[] description() { 084 return description; 085 } 086 } 087 088 /** Default value */ 089 public static final SoapXml DEFAULT = create().build(); 090 091 /** 092 * Instantiates a new builder for this class. 093 * 094 * @return A new builder object. 095 */ 096 public static Builder create() { 097 return new Builder(); 098 } 099}