Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jboss.weld.annotated.slim.unbacked;
  
  import static org.jboss.weld.util.collections.WeldCollections.immutableGuavaSet;
  import static org.jboss.weld.util.reflection.Reflections.cast;
  
  import java.util.HashSet;
 import java.util.Set;
 
 
 
 
 import  edu.umd.cs.findbugs.annotations.SuppressWarnings;

Wrapper for extension-provided AnnotatedType. This may seem unnecessary, however it does mean we are providing a consistent view for debugging, error reporting etc. This implementation is also serializable no matter if the original extension-provided AnnotatedType implementation is.

Parameters:
<X> the type
Author(s):
Pete Muir
Jozef Hartinger
 
 @SuppressWarnings(value = { "SE_NO_SUITABLE_CONSTRUCTOR""SE_NO_SERIALVERSIONID" }, justification = "False positive from FindBugs - serialization is handled by SerializationProxy.")
 public class UnbackedAnnotatedType<X> extends UnbackedAnnotated implements SlimAnnotatedType<X>, Serializable {
 
     public static <X> UnbackedAnnotatedType<X> additionalAnnotatedType(String contextIdAnnotatedType<X> sourceString bdaIdString suffixSharedObjectCache cache) {
         return new UnbackedAnnotatedType<X>(source, AnnotatedTypeIdentifier.of(contextIdbdaIdsource.getJavaClass().getName(), suffixfalse), cache);
     }
 
     public static <X> UnbackedAnnotatedType<X> modifiedAnnotatedType(SlimAnnotatedType<X> originalTypeAnnotatedType<X> sourceSharedObjectCache cache) {
         AnnotatedTypeIdentifier identifier = AnnotatedTypeIdentifier.forModifiedAnnotatedType(originalType.getIdentifier());
         return new UnbackedAnnotatedType<X>(sourceidentifiercache);
     }
 
     private final Class<X> javaClass;
     private final Set<AnnotatedConstructor<X>> constructors;
     private final Set<AnnotatedMethod<? super X>> methods;
     private final Set<AnnotatedField<? super X>> fields;
     private final AnnotatedTypeIdentifier identifier;
 
     private UnbackedAnnotatedType(AnnotatedType<X> sourceAnnotatedTypeIdentifier identifierSharedObjectCache cache) {
         super(source.getBaseType(), source.getTypeClosure(), source.getAnnotations());
         this. = source.getJavaClass();
         Set<AnnotatedConstructor<X>> constructors = new HashSet<AnnotatedConstructor<X>>(source.getConstructors().size());
         for (AnnotatedConstructor<X> constructor : source.getConstructors()) {
             constructors.add(UnbackedAnnotatedConstructor.of(constructorthiscache));
         }
         this. = immutableGuavaSet(constructors);
         Set<AnnotatedMethod<? super X>> methods = new HashSet<AnnotatedMethod<? super X>>(source.getMethods().size());
         for (AnnotatedMethod<? super X> originalMethod : source.getMethods()) {
             methods.add(UnbackedAnnotatedMethod.of(originalMethodthiscache));
         }
         this. = immutableGuavaSet(methods);
         Set<AnnotatedField<? super X>> fields = new HashSet<AnnotatedField<? super X>>(source.getFields().size());
         for (AnnotatedField<? super X> originalField : source.getFields()) {
             fields.add(UnbackedAnnotatedField.of(originalFieldthiscache));
         }
         this. = immutableGuavaSet(fields);
         this. = identifier;
     }
 
     @Override
     public Class<X> getJavaClass() {
         return ;
     }
 
     @Override
     public Set<AnnotatedConstructor<X>> getConstructors() {
         return ;
     }
 
     @Override
     public Set<AnnotatedMethod<? super X>> getMethods() {
         return ;
     }
 
     @Override
     public Set<AnnotatedField<? super X>> getFields() {
         return ;
     }
 
     @Override
     public String toString() {
         return Formats.formatAnnotatedType(this);
    }
    // Serialization
    private Object writeReplace() throws ObjectStreamException {
        return new SerializationProxy<X>(getIdentifier());
    }
    private void readObject(ObjectInputStream streamthrows InvalidObjectException {
        throw ..proxyRequired();
    }
    @Override
    public void clear() {
        // noop
    }
    @Override
    public int hashCode() {
        return .hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof UnbackedAnnotatedType<?>) {
            UnbackedAnnotatedType<?> that = cast(obj);
            return Objects.equal(this.that.identifier);
        }
        return false;
    }
    @Override
        return ;
    }
New to GrepCode? Check out our FAQ X