001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.maven.doxia.sink.impl; 020 021import javax.swing.text.AttributeSet; 022 023/** 024 * Retained so that code compiled against Doxia 2.1.0 or earlier keeps working. The class moved to 025 * {@code doxia-sink-api}, next to the {@link org.apache.maven.doxia.sink.SinkEventAttributes} interface it 026 * implements and the {@link org.apache.maven.doxia.sink.Sink} methods it is passed to, so that attributes can 027 * be created without depending on Doxia internals. 028 * <p> 029 * Instances of this class still behave as before, but it is no longer the type of the attribute sets Doxia 030 * hands out. The inherited constants, and every attribute set produced inside Doxia, are instances of 031 * {@link org.apache.maven.doxia.sink.SinkEventAttributeSet} only. Code that tests them with {@code instanceof} 032 * or casts them to this class has to move to the new class; the constants themselves are unchanged, so 033 * reading them through either name yields the very same objects. 034 * 035 * @deprecated since 2.2.0, use {@link org.apache.maven.doxia.sink.SinkEventAttributeSet} instead. 036 */ 037@Deprecated 038public class SinkEventAttributeSet extends org.apache.maven.doxia.sink.SinkEventAttributeSet { 039 040 /** 041 * Constructs a new, empty SinkEventAttributeSet with default size 5. 042 */ 043 public SinkEventAttributeSet() { 044 super(); 045 } 046 047 /** 048 * Constructs a new, empty SinkEventAttributeSet with the specified initial size. 049 * 050 * @param size the initial number of attribs. 051 */ 052 public SinkEventAttributeSet(int size) { 053 super(size); 054 } 055 056 /** 057 * Constructs a new SinkEventAttributeSet with the attribute name-value 058 * mappings as given by the specified String array. 059 * 060 * @param attributes the specified String array. If the length of this array 061 * is not an even number, an IllegalArgumentException is thrown. 062 */ 063 public SinkEventAttributeSet(String... attributes) { 064 super(attributes); 065 } 066 067 /** 068 * Constructs a new SinkEventAttributeSet with the same attribute name-value 069 * mappings as in the specified AttributeSet. 070 * 071 * @param attributes the specified AttributeSet. 072 */ 073 public SinkEventAttributeSet(AttributeSet attributes) { 074 super(attributes); 075 } 076 077 /** 078 * {@inheritDoc} 079 * 080 * Overridden only to keep returning this type, so that code compiled against the old signature keeps 081 * resolving the method. 082 */ 083 @Override 084 public SinkEventAttributeSet unmodifiable() { 085 super.unmodifiable(); 086 087 return this; 088 } 089 090 /** 091 * Retained so that code referencing the nested class by its old binary name keeps working. Unlike the 092 * constants of the enclosing class, a nested class is not inherited under its old name, so it needs an 093 * explicit subclass here. 094 * 095 * @deprecated Use {@link org.apache.maven.doxia.sink.SinkEventAttributeSet.Semantics} instead. 096 */ 097 @Deprecated 098 public static class Semantics extends org.apache.maven.doxia.sink.SinkEventAttributeSet.Semantics {} 099}