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 <c>atomId</c> 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 * <ul class='seealso'> 032 * <li class='link'>{@doc DtoAtom} 033 * <li class='jp'>{@doc package-summary.html#TOC} 034 * </ul> 035 */ 036@Bean(typeName="id") 037public class Id extends Common { 038 039 private String text; 040 041 /** 042 * Normal constructor. 043 * 044 * @param text The id element contents. 045 */ 046 public Id(String text) { 047 text(text); 048 } 049 050 /** Bean constructor. */ 051 public Id() {} 052 053 054 //----------------------------------------------------------------------------------------------------------------- 055 // Bean properties 056 //----------------------------------------------------------------------------------------------------------------- 057 058 /** 059 * Returns the content of this identifier. 060 * 061 * @return The content of this identifier. 062 */ 063 @Xml(format=TEXT) 064 public String getText() { 065 return text; 066 } 067 068 /** 069 * Sets the content of this identifier. 070 * 071 * @param text The content of this identifier. 072 * @return This object (for method chaining). 073 */ 074 @Beanp("text") 075 public Id text(String text) { 076 this.text = text; 077 return this; 078 } 079 080 081 //----------------------------------------------------------------------------------------------------------------- 082 // Overridden setters (to simplify method chaining) 083 //----------------------------------------------------------------------------------------------------------------- 084 085 @Override /* Common */ 086 public Id base(Object base) { 087 super.base(base); 088 return this; 089 } 090 091 @Override /* Common */ 092 public Id lang(String lang) { 093 super.lang(lang); 094 return this; 095 } 096}