Examples of Identifiable


Examples of com.ponysdk.persistency.Identifiable

        final ObjectMapper mapper = new ObjectMapper();
        final StringWriter jsonOutput = new StringWriter();
        try {
            mapper.writeValue(jsonOutput, object);
            final DBObject dbObject = (DBObject) JSON.parse(jsonOutput.toString());
            final Identifiable m = (Identifiable) object;
            if (m.getID() != null) {
                db.getCollection(nameSpace).findAndModify(new BasicDBObject("_id", m.getID()), dbObject);
            } else {
                final ObjectId id = new ObjectId();
                dbObject.put("_id", id);
                db.getCollection(nameSpace).save(dbObject);
                m.setID(id);
            }
        } catch (final Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.Identifiable

        LinkedList<Identifiable> lhs = new LinkedList<Identifiable>();
        LinkedList<Identifiable> rhs = new LinkedList<Identifiable>();
        String operator = null;

        for (Iterator<Identifiable> it = input.descendingIterator(); it.hasNext();) {
            Identifiable identifiable = it.next();
            if (operator == null) {
                rhs.addFirst(identifiable);

                if (!(identifiable instanceof OperatorToken)) {
                    continue;
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.Identifiable

        return new Conditional(input.get(lhs.size()).getPosition(), lhsInvokable, mhsInvokable, rhsInvokable);
    }

    private static RValue processUnaryOps(LinkedList<Identifiable> input) throws ParserException {
        // Preprocess postfix operators into unary operators
        final Identifiable center;
        LinkedList<UnaryOperator> postfixes = new LinkedList<UnaryOperator>();
        do {
            if (input.isEmpty()) {
                throw new ParserException(-1, "Expression missing.");
            }

            final Identifiable last = input.removeLast();
            if (last instanceof OperatorToken) {
                postfixes.addLast(new UnaryOperator(last.getPosition(), "x" + ((OperatorToken) last).operator));
            } else if (last instanceof UnaryOperator) {
                postfixes.addLast(new UnaryOperator(last.getPosition(), "x" + ((UnaryOperator) last).operator));
            } else {
                center = last;
                break;
            }
        } while (true);

        if (!(center instanceof RValue)) {
            throw new ParserException(center.getPosition(), "Expected expression, found " + center);
        }

        input.addAll(postfixes);

        RValue ret = (RValue) center;
        while (!input.isEmpty()) {
            final Identifiable last = input.removeLast();
            final int lastPosition = last.getPosition();
            if (last instanceof UnaryOperator) {
                final String operator = ((UnaryOperator) last).operator;
                if (operator.equals("+")) {
                    continue;
                }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    public static IdentifiableFactory makeIIOPProfileTemplateFactory()
    {
        return new EncapsulationFactoryBase(TAG_INTERNET_IOP.value) {
            public Identifiable readContents( InputStream in )
            {
                Identifiable result = new IIOPProfileTemplateImpl( in ) ;
                return result ;
            }
        } ;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

            Object current = advance() ;

            private Object advance()
            {
                while (iter.hasNext()) {
                    Identifiable ide = (Identifiable)(iter.next()) ;
                    if (ide.getId() == id)
                        return ide ;
                }

                return null ;
            }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    {
        return new EncapsulationFactoryBase(ORBConstants.TAG_REQUEST_PARTITIONING_ID) {
            public Identifiable readContents(InputStream in)
            {
                int threadPoolToUse = in.read_ulong();
                Identifiable comp =
                    new RequestPartitioningComponentImpl(threadPoolToUse);
                return comp;
            }
        };
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    {
        return new EncapsulationFactoryBase(TAG_ALTERNATE_IIOP_ADDRESS.value) {
            public Identifiable readContents( InputStream in )
            {
                IIOPAddress addr = new IIOPAddressImpl( in ) ;
                Identifiable comp =
                    new AlternateIIOPAddressComponentImpl( addr ) ;
                return comp ;
            }
        } ;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    {
        return new EncapsulationFactoryBase(TAG_JAVA_CODEBASE.value) {
            public Identifiable readContents( InputStream in )
            {
                String url = in.read_string() ;
                Identifiable comp = new JavaCodebaseComponentImpl( url ) ;
                return comp ;
            }
        } ;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    {
        return new EncapsulationFactoryBase(TAG_ORB_TYPE.value) {
            public Identifiable readContents( InputStream in )
            {
                int type = in.read_ulong() ;
                Identifiable comp = new ORBTypeComponentImpl( type ) ;
                return comp ;
            }
        } ;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.Identifiable

    {
        return new EncapsulationFactoryBase(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value) {
            public Identifiable readContents(InputStream in)
            {
                byte version = in.read_octet() ;
                Identifiable comp = new MaxStreamFormatVersionComponentImpl(version);
                return comp ;
            }
        };
    }
View Full Code Here
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.