001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.dto.atom; 014 015import static org.apache.juneau.xml.annotation.XmlFormat.*; 016 017import org.apache.juneau.annotation.*; 018import org.apache.juneau.xml.annotation.*; 019 020/** 021 * Represents an <code>atomId</code> construct in the RFC4287 specification. 022 * 023 * <h5 class='figure'>Schema</h5> 024 * <p class='bcode w800'> 025 * atomId = element atom:id { 026 * atomCommonAttributes, 027 * (atomUri) 028 * } 029 * </p> 030 * 031 * <h5 class='section'>See Also:</h5> 032 * <ul class='doctree'> 033 * <li class='link'>{@doc juneau-dto.Atom} 034 * <li class='jp'>{@doc package-summary.html#TOC} 035 * </ul> 036 */ 037@Bean(typeName="id") 038public class Id extends Common { 039 040 private String text; 041 042 /** 043 * Normal constructor. 044 * 045 * @param text The id element contents. 046 */ 047 public Id(String text) { 048 text(text); 049 } 050 051 /** Bean constructor. */ 052 public Id() {} 053 054 055 //----------------------------------------------------------------------------------------------------------------- 056 // Bean properties 057 //----------------------------------------------------------------------------------------------------------------- 058 059 /** 060 * Returns the content of this identifier. 061 * 062 * @return The content of this identifier. 063 */ 064 @Xml(format=TEXT) 065 public String getText() { 066 return text; 067 } 068 069 /** 070 * Sets the content of this identifier. 071 * 072 * @param text The content of this identifier. 073 * @return This object (for method chaining). 074 */ 075 @BeanProperty("text") 076 public Id text(String text) { 077 this.text = text; 078 return this; 079 } 080 081 082 //----------------------------------------------------------------------------------------------------------------- 083 // Overridden setters (to simplify method chaining) 084 //----------------------------------------------------------------------------------------------------------------- 085 086 @Override /* Common */ 087 public Id base(Object base) { 088 super.base(base); 089 return this; 090 } 091 092 @Override /* Common */ 093 public Id lang(String lang) { 094 super.lang(lang); 095 return this; 096 } 097}