Package com.tinkerpop.frames.modules.typedgraph

Source Code of com.tinkerpop.frames.modules.typedgraph.TypedGraphModuleBuilder

package com.tinkerpop.frames.modules.typedgraph;

import com.tinkerpop.frames.FramedGraphConfiguration;
import com.tinkerpop.frames.modules.AbstractModule;
import com.tinkerpop.frames.modules.Module;

/**
* TODO
*/
public class TypedGraphModuleBuilder {
  private TypeRegistry typeRegistry = new TypeRegistry();
 
  public TypedGraphModuleBuilder() {
   
  }
 
  public TypedGraphModuleBuilder withClass(Class<?> type) {
    typeRegistry.add(type);
    return this;
  }
 
  public Module build() {
    final TypeManager manager = new TypeManager(typeRegistry);
    return new AbstractModule() {
     
      @Override
      public void doConfigure(FramedGraphConfiguration config) {
        config.addTypeResolver(manager);
        config.addFrameInitializer(manager);
      }     
    };
  }
}
TOP

Related Classes of com.tinkerpop.frames.modules.typedgraph.TypedGraphModuleBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.