- Revision
- 1383
- Author
- rfscholte
- Date
- 2011-10-09 04:49:36 -0500 (Sun, 09 Oct 2011)
Log Message
Move default implementation of DocletTag to separate package
Modified Paths
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTagFactory.java
- trunk/qdox/src/test/java/com/thoughtworks/qdox/writer/DefaultModelWriterTest.java
Added Paths
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultDocletTag.java
- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/DefaultDocletTagTest.java
Removed Paths
Diff
Deleted: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTag.java (1382 => 1383)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTag.java 2011-10-09 09:46:30 UTC (rev 1382) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTag.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -1,86 +0,0 @@ -package com.thoughtworks.qdox.model; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.List; -import java.util.Map; - -import com.thoughtworks.qdox.model.util.TagParser; - -public class DefaultDocletTag implements DocletTag { - - private final String name; - private final String value; - private final int lineNumber; - - private List<String> parameters; - private Map<String, String> namedParameters; - private AbstractJavaModel context; - - public DefaultDocletTag(String name, String value, - AbstractJavaModel context, - int lineNumber) - { - this.name = name; - this.value = value; - this.context = context; - this.lineNumber = lineNumber; - } - - public DefaultDocletTag(String name, String value) { - this(name, value, null, 0); - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - public List<String> getParameters() { - if (parameters == null) { - parameters = TagParser.parseParameters(value); - } - return parameters; - } - - public Map<String, String> getNamedParameterMap() { - if (namedParameters == null) { - namedParameters = TagParser.parseNamedParameters(value); - } - return namedParameters; - } - - public String getNamedParameter(String key) { - return (String) getNamedParameterMap().get(key); - } - - public final AbstractJavaModel getContext() { - return context; - } - - public int getLineNumber() { - return lineNumber; - } -} - -
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTagFactory.java (1382 => 1383)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTagFactory.java 2011-10-09 09:46:30 UTC (rev 1382) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTagFactory.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -1,5 +1,7 @@ package com.thoughtworks.qdox.model; +import com.thoughtworks.qdox.model.impl.DefaultDocletTag; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file
Copied: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultDocletTag.java (from rev 1303, trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultDocletTag.java) (0 => 1383)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultDocletTag.java (rev 0) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultDocletTag.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -0,0 +1,88 @@ +package com.thoughtworks.qdox.model.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.List; +import java.util.Map; + +import com.thoughtworks.qdox.model.AbstractJavaModel; +import com.thoughtworks.qdox.model.DocletTag; +import com.thoughtworks.qdox.model.util.TagParser; + +public class DefaultDocletTag implements DocletTag { + + private final String name; + private final String value; + private final int lineNumber; + + private List<String> parameters; + private Map<String, String> namedParameters; + private AbstractJavaModel context; + + public DefaultDocletTag(String name, String value, + AbstractJavaModel context, + int lineNumber) + { + this.name = name; + this.value = value; + this.context = context; + this.lineNumber = lineNumber; + } + + public DefaultDocletTag(String name, String value) { + this(name, value, null, 0); + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public List<String> getParameters() { + if (parameters == null) { + parameters = TagParser.parseParameters(value); + } + return parameters; + } + + public Map<String, String> getNamedParameterMap() { + if (namedParameters == null) { + namedParameters = TagParser.parseNamedParameters(value); + } + return namedParameters; + } + + public String getNamedParameter(String key) { + return (String) getNamedParameterMap().get(key); + } + + public final AbstractJavaModel getContext() { + return context; + } + + public int getLineNumber() { + return lineNumber; + } +} + +
Deleted: trunk/qdox/src/test/java/com/thoughtworks/qdox/model/DefaultDocletTagTest.java (1382 => 1383)
--- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/DefaultDocletTagTest.java 2011-10-09 09:46:30 UTC (rev 1382) +++ trunk/qdox/src/test/java/com/thoughtworks/qdox/model/DefaultDocletTagTest.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -1,33 +0,0 @@ -package com.thoughtworks.qdox.model; - -import java.util.Map; - -import com.thoughtworks.qdox.model.util.SerializationUtils; - -/** - * - * @author Aslak Hellesøy - * @version $Revision$ - */ -public class DefaultDocletTagTest extends AbstractDocletTagTest { - - public DefaultDocletTagTest(String name) { - super(name); - } - - private final DocletTagFactory docletTagFactory = new DefaultDocletTagFactory(); - - protected DocletTagFactory getDocletTagFactory() { - return docletTagFactory; - } - - public void testJiraQdox60() throws Exception { - DefaultDocletTag tag = new DefaultDocletTag("author", "<a href="" Development Team</a>"); - - tag = (DefaultDocletTag) SerializationUtils.serializedCopy(tag); - - Map paramMap = tag.getNamedParameterMap(); - assertEquals(0, paramMap.size()); - } - -}
Copied: trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/DefaultDocletTagTest.java (from rev 1303, trunk/qdox/src/test/java/com/thoughtworks/qdox/model/DefaultDocletTagTest.java) (0 => 1383)
--- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/DefaultDocletTagTest.java (rev 0) +++ trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/DefaultDocletTagTest.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -0,0 +1,36 @@ +package com.thoughtworks.qdox.model.impl; + +import java.util.Map; + +import com.thoughtworks.qdox.model.AbstractDocletTagTest; +import com.thoughtworks.qdox.model.DefaultDocletTagFactory; +import com.thoughtworks.qdox.model.DocletTagFactory; +import com.thoughtworks.qdox.model.util.SerializationUtils; + +/** + * + * @author Aslak Hellesøy + * @version $Revision$ + */ +public class DefaultDocletTagTest extends AbstractDocletTagTest { + + public DefaultDocletTagTest(String name) { + super(name); + } + + private final DocletTagFactory docletTagFactory = new DefaultDocletTagFactory(); + + protected DocletTagFactory getDocletTagFactory() { + return docletTagFactory; + } + + public void testJiraQdox60() throws Exception { + DefaultDocletTag tag = new DefaultDocletTag("author", "<a href="" Development Team</a>"); + + tag = (DefaultDocletTag) SerializationUtils.serializedCopy(tag); + + Map paramMap = tag.getNamedParameterMap(); + assertEquals(0, paramMap.size()); + } + +}
Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/writer/DefaultModelWriterTest.java (1382 => 1383)
--- trunk/qdox/src/test/java/com/thoughtworks/qdox/writer/DefaultModelWriterTest.java 2011-10-09 09:46:30 UTC (rev 1382) +++ trunk/qdox/src/test/java/com/thoughtworks/qdox/writer/DefaultModelWriterTest.java 2011-10-09 09:49:36 UTC (rev 1383) @@ -9,9 +9,9 @@ import org.junit.Before; -import com.thoughtworks.qdox.model.DefaultDocletTag; import com.thoughtworks.qdox.model.DocletTag; import com.thoughtworks.qdox.model.JavaAnnotatedElement; +import com.thoughtworks.qdox.model.impl.DefaultDocletTag; import com.thoughtworks.qdox.writer.DefaultModelWriter; public class DefaultModelWriterTest {
To unsubscribe from this list please visit:
