コード例 #1
0
 public Transformer getTransformer(String elementType, String name) {
   for (TransformerBuilder builder : Lookup.getDefault().lookupAll(TransformerBuilder.class)) {
     if (builder.isTransformerForElement(elementType) && builder.getName().equals(name)) {
       return builder.buildTransformer();
     }
   }
   return null;
 }
コード例 #2
0
 public Transformer[] getTransformers(String elementType) {
   List<Transformer> transformers = new ArrayList<Transformer>();
   for (TransformerBuilder builder : Lookup.getDefault().lookupAll(TransformerBuilder.class)) {
     if (builder.isTransformerForElement(elementType)) {
       transformers.add(builder.buildTransformer());
     }
   }
   return transformers.toArray(new Transformer[0]);
 }