static

in gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java [177:379]


    static {
        /////////////
        // CLASSES //
        /////////////

        // structure
        CLASS_IMPORTS.add(Edge.class);
        CLASS_IMPORTS.add(Element.class);
        CLASS_IMPORTS.add(Graph.class);
        CLASS_IMPORTS.add(Property.class);
        CLASS_IMPORTS.add(Transaction.class);
        CLASS_IMPORTS.add(Vertex.class);
        CLASS_IMPORTS.add(VertexProperty.class);
        CLASS_IMPORTS.add(GraphFactory.class);
        CLASS_IMPORTS.add(ElementHelper.class);
        CLASS_IMPORTS.add(ReferenceEdge.class);
        CLASS_IMPORTS.add(ReferenceProperty.class);
        CLASS_IMPORTS.add(ReferenceVertex.class);
        CLASS_IMPORTS.add(ReferenceVertexProperty.class);
        
        // tokens
        CLASS_IMPORTS.add(SackFunctions.class);
        CLASS_IMPORTS.add(SackFunctions.Barrier.class);
        CLASS_IMPORTS.add(VertexProperty.Cardinality.class);
        CLASS_IMPORTS.add(Column.class);
        CLASS_IMPORTS.add(Direction.class);
        CLASS_IMPORTS.add(DT.class);
        CLASS_IMPORTS.add(Merge.class);
        CLASS_IMPORTS.add(Operator.class);
        CLASS_IMPORTS.add(Order.class);
        CLASS_IMPORTS.add(Pop.class);
        CLASS_IMPORTS.add(Scope.class);
        CLASS_IMPORTS.add(T.class);
        CLASS_IMPORTS.add(TraversalOptionParent.class);
        CLASS_IMPORTS.add(Pick.class);
        CLASS_IMPORTS.add(P.class);
        CLASS_IMPORTS.add(TextP.class);
        CLASS_IMPORTS.add(WithOptions.class);
        // remote
        CLASS_IMPORTS.add(RemoteConnection.class);
        CLASS_IMPORTS.add(EmptyGraph.class);
        // io
        CLASS_IMPORTS.add(GraphReader.class);
        CLASS_IMPORTS.add(GraphWriter.class);
        CLASS_IMPORTS.add(Io.class);
        CLASS_IMPORTS.add(IO.class);
        CLASS_IMPORTS.add(IoCore.class);
        CLASS_IMPORTS.add(Storage.class);
        CLASS_IMPORTS.add(GraphMLIo.class);
        CLASS_IMPORTS.add(GraphMLMapper.class);
        CLASS_IMPORTS.add(GraphMLReader.class);
        CLASS_IMPORTS.add(GraphMLWriter.class);
        CLASS_IMPORTS.add(GraphSONIo.class);
        CLASS_IMPORTS.add(GraphSONMapper.class);
        CLASS_IMPORTS.add(GraphSONReader.class);
        CLASS_IMPORTS.add(GraphSONTokens.class);
        CLASS_IMPORTS.add(GraphSONVersion.class);
        CLASS_IMPORTS.add(GraphSONWriter.class);
        CLASS_IMPORTS.add(LegacyGraphSONReader.class);
        CLASS_IMPORTS.add(GryoClassResolverV1.class);
        CLASS_IMPORTS.add(GryoClassResolverV3.class);
        CLASS_IMPORTS.add(GryoIo.class);
        CLASS_IMPORTS.add(GryoMapper.class);
        CLASS_IMPORTS.add(GryoReader.class);
        CLASS_IMPORTS.add(GryoVersion.class);
        CLASS_IMPORTS.add(GryoWriter.class);
        // configuration
        CLASS_IMPORTS.add(BaseConfiguration.class);
        CLASS_IMPORTS.add(CombinedConfiguration.class);
        CLASS_IMPORTS.add(CompositeConfiguration.class);
        CLASS_IMPORTS.add(Configuration.class);
        CLASS_IMPORTS.add(ConfigurationUtils.class);
        CLASS_IMPORTS.add(HierarchicalConfiguration.class);
        CLASS_IMPORTS.add(MapConfiguration.class);
        CLASS_IMPORTS.add(PropertiesConfiguration.class);
        CLASS_IMPORTS.add(SubsetConfiguration.class);
        CLASS_IMPORTS.add(XMLConfiguration.class);
        CLASS_IMPORTS.add(Configurations.class);
        // strategies
        CLASS_IMPORTS.add(ConnectiveStrategy.class);
        CLASS_IMPORTS.add(ComputerFinalizationStrategy.class);
        CLASS_IMPORTS.add(ElementIdStrategy.class);
        CLASS_IMPORTS.add(EventStrategy.class);
        CLASS_IMPORTS.add(HaltedTraverserStrategy.class);
        CLASS_IMPORTS.add(InlineFilterStrategy.class);
        CLASS_IMPORTS.add(MessagePassingReductionStrategy.class);
        CLASS_IMPORTS.add(OptionsStrategy.class);
        CLASS_IMPORTS.add(PartitionStrategy.class);
        CLASS_IMPORTS.add(ReservedKeysVerificationStrategy.class);
        CLASS_IMPORTS.add(SubgraphStrategy.class);
        CLASS_IMPORTS.add(LazyBarrierStrategy.class);
        CLASS_IMPORTS.add(MatchAlgorithmStrategy.class);
        CLASS_IMPORTS.add(ProfileStrategy.class);
        CLASS_IMPORTS.add(AdjacentToIncidentStrategy.class);
        CLASS_IMPORTS.add(ByModulatorOptimizationStrategy.class);
        CLASS_IMPORTS.add(ProductiveByStrategy.class);
        CLASS_IMPORTS.add(CountStrategy.class);
        CLASS_IMPORTS.add(FilterRankingStrategy.class);
        CLASS_IMPORTS.add(IdentityRemovalStrategy.class);
        CLASS_IMPORTS.add(IncidentToAdjacentStrategy.class);
        CLASS_IMPORTS.add(MatchPredicateStrategy.class);
        CLASS_IMPORTS.add(EarlyLimitStrategy.class);
        CLASS_IMPORTS.add(OrderLimitStrategy.class);
        CLASS_IMPORTS.add(PathProcessorStrategy.class);
        CLASS_IMPORTS.add(ComputerVerificationStrategy.class);
        CLASS_IMPORTS.add(LambdaRestrictionStrategy.class);
        CLASS_IMPORTS.add(PathRetractionStrategy.class);
        CLASS_IMPORTS.add(ReadOnlyStrategy.class);
        CLASS_IMPORTS.add(ReferenceElementStrategy.class);
        CLASS_IMPORTS.add(RepeatUnrollStrategy.class);
        CLASS_IMPORTS.add(SeedStrategy.class);
        CLASS_IMPORTS.add(StandardVerificationStrategy.class);
        CLASS_IMPORTS.add(EdgeLabelVerificationStrategy.class);
        CLASS_IMPORTS.add(VertexProgramRestrictionStrategy.class);
        // graph traversal
        CLASS_IMPORTS.add(AnonymousTraversalSource.class);
        CLASS_IMPORTS.add(__.class);
        CLASS_IMPORTS.add(GraphTraversal.class);
        CLASS_IMPORTS.add(GraphTraversalSource.class);
        CLASS_IMPORTS.add(Traversal.class);
        CLASS_IMPORTS.add(TraversalMetrics.class);
        // graph computer
        CLASS_IMPORTS.add(Computer.class);
        CLASS_IMPORTS.add(ComputerResult.class);
        CLASS_IMPORTS.add(ConnectedComponent.class);
        CLASS_IMPORTS.add(ConnectedComponentVertexProgram.class);
        CLASS_IMPORTS.add(GraphComputer.class);
        CLASS_IMPORTS.add(Memory.class);
        CLASS_IMPORTS.add(VertexProgram.class);
        CLASS_IMPORTS.add(CloneVertexProgram.class);
        CLASS_IMPORTS.add(ClusterCountMapReduce.class);
        CLASS_IMPORTS.add(ClusterPopulationMapReduce.class);
        CLASS_IMPORTS.add(MemoryTraversalSideEffects.class);
        CLASS_IMPORTS.add(PeerPressure.class);
        CLASS_IMPORTS.add(PeerPressureVertexProgram.class);
        CLASS_IMPORTS.add(PageRank.class);
        CLASS_IMPORTS.add(PageRankMapReduce.class);
        CLASS_IMPORTS.add(PageRankVertexProgram.class);
        CLASS_IMPORTS.add(ShortestPath.class);
        CLASS_IMPORTS.add(ShortestPathVertexProgram.class);
        CLASS_IMPORTS.add(GraphFilterStrategy.class);
        CLASS_IMPORTS.add(TraversalVertexProgram.class);
        CLASS_IMPORTS.add(VertexProgramStrategy.class);
        // utils
        CLASS_IMPORTS.add(Gremlin.class);
        CLASS_IMPORTS.add(IteratorUtils.class);
        CLASS_IMPORTS.add(TimeUtil.class);
        CLASS_IMPORTS.add(Lambda.class);
        CLASS_IMPORTS.add(java.util.Date.class);
        CLASS_IMPORTS.add(java.time.OffsetDateTime.class);
        CLASS_IMPORTS.add(java.sql.Timestamp.class);
        CLASS_IMPORTS.add(java.util.UUID.class);
        CLASS_IMPORTS.add(GremlinTranslator.class);
        CLASS_IMPORTS.add(Translator.class);

        /////////////
        // METHODS //
        /////////////

        uniqueMethods(IoCore.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(P.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(AnonymousTraversalSource.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(TextP.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(__.class).filter(m -> !m.getName().equals("__")).forEach(METHOD_IMPORTS::add);
        uniqueMethods(Computer.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(TimeUtil.class).forEach(METHOD_IMPORTS::add);
        uniqueMethods(Lambda.class).forEach(METHOD_IMPORTS::add);
        try {
            METHOD_IMPORTS.add(DatetimeHelper.class.getMethod("datetime", String.class));
            METHOD_IMPORTS.add(DatetimeHelper.class.getMethod("datetime"));
        } catch (Exception ex) {
            throw new IllegalStateException("Could not load datetime() function to imports");
        }

        ///////////
        // ENUMS //
        ///////////

        Collections.addAll(ENUM_IMPORTS, SackFunctions.Barrier.values());
        Collections.addAll(ENUM_IMPORTS, VertexProperty.Cardinality.values());
        Collections.addAll(ENUM_IMPORTS, Column.values());
        Collections.addAll(ENUM_IMPORTS, Direction.values());
        Collections.addAll(ENUM_IMPORTS, DT.values());
        Collections.addAll(ENUM_IMPORTS, Merge.values());
        Collections.addAll(ENUM_IMPORTS, Operator.values());
        Collections.addAll(ENUM_IMPORTS, Order.values());
        Collections.addAll(ENUM_IMPORTS, Pop.values());
        Collections.addAll(ENUM_IMPORTS, Scope.values());
        Collections.addAll(ENUM_IMPORTS, T.values());
        Collections.addAll(ENUM_IMPORTS, Pick.values());

        ////////////
        // FIELDS //
        ////////////

        try {
            FIELD_IMPORTS.add(Double.class.getField("NaN"));
            FIELD_IMPORTS.add(Direction.class.getField("from"));
            FIELD_IMPORTS.add(Direction.class.getField("to"));
        } catch (Exception ex) {
            throw new IllegalStateException(ex);
        }
    }