Java 8 AnnotationValue - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AnnotationValue class.

This code example shows how to use the following methods:accept
 
  private static final class PrintVisitor extends SimpleAnnotationValueVisitor7<Void, Void> {
    final StringBuilder builder = new StringBuilder();
 
    void visitValue(AnnotationValue value) {
      value.accept(this, null);
    } 
 
    @Override 
    protected Void defaultAction(Object o, Void p) {
      builder.append(o);
      return null; 
    } 
 
    @Override 
    public Void visitString(String s, Void p) {
      builder.append(StringLiterals.toLiteral(s));
      return null; 
    } 
 
3
CodeRank
This code example shows how to use the following methods:getValue
                result.addAll( extractValue( (AnnotationValue) active ) );
            } 
            return result;
        } 
        return new ArrayList<String>( 1 ) {{
            add( value.getValue().toString() );
        }}; 
    } 
 
    private static String collectionAsString( final Collection<String> collection ) {
        final StringBuilder sb = new StringBuilder();
 
        Iterator<String> iterator = collection.iterator();
        int i = 0;
        while ( iterator.hasNext() ) {
            final String next = iterator.next();
            sb.append( '"' ).append( next ).append( '"' );
            if ( i + 1 < collection.size() ) {
                sb.append( ", " );
            } 
2
CodeRank
See Code Examples for Java 8 AnnotationValue Methods: