- Revision
- 1392
- Author
- rfscholte
- Date
- 2011-10-09 14:38:18 -0500 (Sun, 09 Oct 2011)
Log Message
Move AbstractBaseJavaEntity to separate package
Modified Paths
- trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/DefaultAnnotationTransformer.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/ModelBuilder.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/_expression_/FieldRef.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntity.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java
- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntityTest.java
Added Paths
Removed Paths
Diff
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/DefaultAnnotationTransformer.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/DefaultAnnotationTransformer.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/DefaultAnnotationTransformer.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -23,7 +23,6 @@ import java.util.List; import java.util.Map; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.Type; import com.thoughtworks.qdox.model._expression_.Add; import com.thoughtworks.qdox.model._expression_.And; @@ -56,6 +55,7 @@ import com.thoughtworks.qdox.model._expression_.Subtract; import com.thoughtworks.qdox.model._expression_.TypeRef; import com.thoughtworks.qdox.model._expression_.UnsignedShiftRight; +import com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.impl.DefaultJavaAnnotation; import com.thoughtworks.qdox.parser._expression_.AnnotationAdd; import com.thoughtworks.qdox.parser._expression_.AnnotationAnd;
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/ModelBuilder.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/ModelBuilder.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/builder/ModelBuilder.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -26,7 +26,6 @@ import java.util.Set; import com.thoughtworks.qdox.library.ClassLibrary; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.DefaultJavaConstructor; import com.thoughtworks.qdox.model.DefaultJavaMethod; import com.thoughtworks.qdox.model.DefaultJavaParameter; @@ -42,6 +41,7 @@ import com.thoughtworks.qdox.model.JavaSource; import com.thoughtworks.qdox.model.JavaType; import com.thoughtworks.qdox.model.Type; +import com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.impl.DefaultJavaAnnotation; import com.thoughtworks.qdox.model.impl.DefaultJavaClass; import com.thoughtworks.qdox.model.impl.DefaultJavaField;
Deleted: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseJavaEntity.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseJavaEntity.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseJavaEntity.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -1,118 +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.io.Serializable; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import com.thoughtworks.qdox.model.impl.AbstractJavaModel; - -public abstract class AbstractBaseJavaEntity extends AbstractJavaModel implements Serializable { - - private List<JavaAnnotation> annotations = Collections.emptyList(); - private String comment; - private List<DocletTag> tags = Collections.emptyList(); - - public AbstractBaseJavaEntity() - { - super(); - } - - public List<JavaAnnotation> getAnnotations() - { - return annotations; - } - - public void setAnnotations( List<JavaAnnotation> annotations ) - { - this.annotations = annotations; - } - - /** - * Not every entity has a parentClass, but AnnotationFieldRef requires access to it. - * When used with JavaClass, don't confuse this with getSuperClass() - * - * @return the surrounding class - */ - public JavaClass getParentClass() - { - return null; - } - - public String getComment() - { - return comment; - } - - public void setComment( String comment ) - { - this.comment = comment; - } - - public List<DocletTag> getTags() - { - return tags; - } - - public List<DocletTag> getTagsByName( String name ) - { - List<DocletTag> specifiedTags = new LinkedList<DocletTag>(); - for ( DocletTag docletTag : tags ) - { - if ( docletTag.getName().equals( name ) ) - { - specifiedTags.add( docletTag ); - } - } - return specifiedTags; - } - - public DocletTag getTagByName( String name ) - { - for ( DocletTag docletTag : tags ) - { - if ( docletTag.getName().equals( name ) ) - { - return docletTag; - } - } - return null; - } - - /** - * Convenience method for <code>getTagByName(String).getNamedParameter(String)</code> that also checks for null tag. - * - * @param tagName the name of the docletTag - * @param parameterName the name of the parameter - * @since 1.3 - */ - public String getNamedParameter( String tagName, String parameterName ) - { - DocletTag tag = getTagByName( tagName ); - return ( tag != null ? tag.getNamedParameter( parameterName ) : null ); - } - - public void setTags( List<DocletTag> tagList ) - { - this.tags = tagList; - } -} \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -1,5 +1,7 @@ package com.thoughtworks.qdox.model; +import com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/_expression_/FieldRef.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/_expression_/FieldRef.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/_expression_/FieldRef.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -21,11 +21,11 @@ import java.util.StringTokenizer; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.JavaClass; import com.thoughtworks.qdox.model.JavaClassParent; import com.thoughtworks.qdox.model.JavaField; import com.thoughtworks.qdox.model.Type; +import com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity; public class FieldRef implements AnnotationValue {
Copied: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractBaseJavaEntity.java (from rev 1386, trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseJavaEntity.java) (0 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractBaseJavaEntity.java (rev 0) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractBaseJavaEntity.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -0,0 +1,120 @@ +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.io.Serializable; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import com.thoughtworks.qdox.model.DocletTag; +import com.thoughtworks.qdox.model.JavaAnnotation; +import com.thoughtworks.qdox.model.JavaClass; + +public abstract class AbstractBaseJavaEntity extends AbstractJavaModel implements Serializable { + + private List<JavaAnnotation> annotations = Collections.emptyList(); + private String comment; + private List<DocletTag> tags = Collections.emptyList(); + + public AbstractBaseJavaEntity() + { + super(); + } + + public List<JavaAnnotation> getAnnotations() + { + return annotations; + } + + public void setAnnotations( List<JavaAnnotation> annotations ) + { + this.annotations = annotations; + } + + /** + * Not every entity has a parentClass, but AnnotationFieldRef requires access to it. + * When used with JavaClass, don't confuse this with getSuperClass() + * + * @return the surrounding class + */ + public JavaClass getParentClass() + { + return null; + } + + public String getComment() + { + return comment; + } + + public void setComment( String comment ) + { + this.comment = comment; + } + + public List<DocletTag> getTags() + { + return tags; + } + + public List<DocletTag> getTagsByName( String name ) + { + List<DocletTag> specifiedTags = new LinkedList<DocletTag>(); + for ( DocletTag docletTag : tags ) + { + if ( docletTag.getName().equals( name ) ) + { + specifiedTags.add( docletTag ); + } + } + return specifiedTags; + } + + public DocletTag getTagByName( String name ) + { + for ( DocletTag docletTag : tags ) + { + if ( docletTag.getName().equals( name ) ) + { + return docletTag; + } + } + return null; + } + + /** + * Convenience method for <code>getTagByName(String).getNamedParameter(String)</code> that also checks for null tag. + * + * @param tagName the name of the docletTag + * @param parameterName the name of the parameter + * @since 1.3 + */ + public String getNamedParameter( String tagName, String parameterName ) + { + DocletTag tag = getTagByName( tagName ); + return ( tag != null ? tag.getNamedParameter( parameterName ) : null ); + } + + public void setTags( List<DocletTag> tagList ) + { + this.tags = tagList; + } +} \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntity.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntity.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntity.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -22,7 +22,6 @@ import java.util.Collections; import java.util.List; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.JavaClass; import com.thoughtworks.qdox.model.JavaModel;
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java (1391 => 1392)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -24,7 +24,6 @@ import java.util.List; import com.thoughtworks.qdox.library.ClassLibrary; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.JavaClass; import com.thoughtworks.qdox.model.JavaModelUtils; import com.thoughtworks.qdox.model.JavaPackage;
Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntityTest.java (1391 => 1392)
--- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntityTest.java 2011-10-09 19:23:33 UTC (rev 1391) +++ trunk/qdox/src/test/java/com/thoughtworks/qdox/model/impl/AbstractJavaEntityTest.java 2011-10-09 19:38:18 UTC (rev 1392) @@ -13,7 +13,6 @@ import org.junit.Test; -import com.thoughtworks.qdox.model.AbstractBaseJavaEntity; import com.thoughtworks.qdox.model.DocletTag; public class AbstractJavaEntityTest {
To unsubscribe from this list please visit:
