samples/componentinjection/anagram-modular/src-api-compiletimecaches/org/apidesign/anagram/impl/annotations/WordsImpl.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 20 Jun 2009 16:06:19 +0200
changeset 336 219810ff3c72
permissions -rw-r--r--
Example of "compile time caches" and their possible usage in Component Injection area
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 
     6 package org.apidesign.anagram.impl.annotations;
     7 
     8 import java.util.Map;
     9 import org.apidesign.anagram.api.WordLibrary;
    10 
    11 /**
    12  *
    13  * @author Jaroslav Tulach <jtulach@netbeans.org>
    14  */
    15 // BEGIN: anagram.api.WordsImpl
    16 public class WordsImpl implements WordLibrary {
    17     private Map<String,Object> map;
    18 
    19     private WordsImpl(Map<String,Object> m) {
    20         this.map = m;
    21     }
    22 
    23     public static WordsImpl create(Map attributes) {
    24         return new WordsImpl(attributes);
    25     }
    26 
    27     public String[] getWords() {
    28         return (String[])map.get("words"); // NOI18N
    29     }
    30 }
    31 // END: anagram.api.WordsImpl