End the traversal of the domain object graph matching a specific type of domain objects
@param domainObjectType
@return a DomainObjectMatch
489140
public <T> DomainObjectMatch<T> TO(Class<T> domainObjectType) {
		TraversalExpression te = (TraversalExpression)this.astObject;
		DomainObjectMatch<T> ret =APIAccess.createDomainObjectMatch(domainObjectType,
				te.getQueryExecutor().getDomainObjectMatches().size(),
				te.getQueryExecutor().getMappingInfo());
		te.getQueryExecutor().getDomainObjectMatches().add(ret);
		te.setEnd(ret);
		QueryRecorder.recordAssignment(this, "TO", ret, QueryRecorder.literal(domainObjectType.getName()));
		return ret;
	}
915922
public String generateDiff(String objectType, Object from, Object to) {
        GenericObject fromGenericObject = from == null ? null : genericObjectFramework.serialize(from, objectType);
        GenericObject toGenericObject = to == null ? null : genericObjectFramework.serialize(to, objectType);

        return generateDiff(fromGenericObject, toGenericObject);
    }
1324116
public void finishJson(final Type type, final Object obj) {
        this.contentType = this.jsonContentType;
        this.output = obj;
        finish(request.getJsonConvert().convertTo(getBodyBufferSupplier(), type, obj));
    }
548679
private String determineResultClassName(ClassObjectType objType) {
        String className = objType.getClassName();
        if ( List.class.getName().equals( className ) ) {
            className = ArrayList.class.getName();
        } else if ( Set.class.getName().equals( className ) ) {
            className = HashSet.class.getName();
        } else if ( Collection.class.getName().equals( className ) ) {
            className = ArrayList.class.getName();
        }
        return className;
    }
1260307
def LookupWsdlType(self, ns, name, allowManagedObjectReference=False):
      
      try:
         return GetWsdlType(ns, name)
      except KeyError:
         if allowManagedObjectReference:
            if name.endswith('ManagedObjectReference') and ns == XMLNS_VMODL_BASE:
               return GetWsdlType(ns, name[:-len('Reference')])
         # WARNING!!! This is a temporary hack to get around server not
         # honoring @service tag (see bug 521744). Once it is fix, I am
         # going to back out this change
         if name.endswith('ManagedObjectReference') and allowManagedObjectReference:
            return GetWsdlType(XMLNS_VMODL_BASE, name[:-len('Reference')])
         return GuessWsdlType(name)
1020244
public void endObject(String objectType) {
        logger.debug("END: " + objectType);
        if (objectType.equals("Molecule")) {
            eventReader.fireFrameRead();
            clearData();
        } else if (objectType.equals("Atom")) {
            currentMolecule.addAtom(currentAtom);
        } else if (objectType.equals("Bond")) {
            logger.debug("Bond(" + bond_id + "): " + bond_a1 + ", " + bond_a2 + ", " + bond_order);
            if (bond_a1 > currentMolecule.getAtomCount() || bond_a2 > currentMolecule.getAtomCount()) {
                logger.error("Cannot add bond between at least one non-existant atom: " + bond_a1 + " and " + bond_a2);
            } else {
                IAtom a1 = currentMolecule.getAtom(bond_a1);
                IAtom a2 = currentMolecule.getAtom(bond_a2);
                IBond b = builder.newInstance(IBond.class, a1, a2, bond_order);
                if (bond_id != null) b.setID(bond_id);
                if (bond_stereo != CDKConstants.UNSET) {
                    b.setStereo(bond_stereo);
                }
                currentMolecule.addBond(b);
            }
        }
    }
654840
public <E> TerminalResult IN(DomainObjectMatch<E> domainObjects) {
		DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjects);
		DomainObjectMatch<?> match = delegate != null ? delegate : domainObjects;
		getPredicateExpression().setOperator(Operator.IN);
		getPredicateExpression().setValue_2(match);
		TerminalResult ret = APIAccess.createTerminalResult(this.getPredicateExpression());
		QueryRecorder.recordInvocation(this, "IN", ret, QueryRecorder.placeHolder(match));
		return ret;
	}
1047470
private Node getNode(Object entity, ObjectGraph graph, NodeState initialNodeState)
    {
        if (entity == null)
        {
            return null;
        }
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(pd.getKunderaMetadata(),
                entity.getClass());

        // entity metadata could be null.
        if (entityMetadata == null)
        {
            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        Object id = PropertyAccessorHelper.getId(entity, entityMetadata);
        // Generate and set Id if @GeneratedValue present.
        if (((Field) entityMetadata.getIdAttribute().getJavaMember()).isAnnotationPresent(GeneratedValue.class))
        {
            if (!isIdSet(id))
            {
                id = idGenerator.generateAndSetId(entity, entityMetadata, pd, pd.getKunderaMetadata());
            }
        }

        if (!validator.isValidEntityObject(entity, entityMetadata))
        {
            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        // id = PropertyAccessorHelper.getId(entity, entityMetadata);

        String nodeId = ObjectGraphUtils.getNodeId(id, entity.getClass());
        Node node = graph.getNode(nodeId);

        // If this node is already there in graph (may happen for bidirectional
        // relationship, do nothing and return null)
        if (node != null)
        {
            if (node.isGraphCompleted())
            {
                return node;
            }
            return null;
        }

        // Construct this Node first, if one not already there in Persistence
        // Cache
        Node nodeInPersistenceCache = persistenceCache.getMainCache().getNodeFromCache(nodeId, pd);

        // Make a deep copy of entity data

        if (nodeInPersistenceCache == null)
        {
            node = new Node(nodeId, entity, initialNodeState, persistenceCache, id, pd);
        }
        else
        {
            node = nodeInPersistenceCache;
            node.setPersistenceCache(persistenceCache);

            // Determine whether this node is dirty based on comparison between
            // Node data and entity data
            // If dirty, set the entity data into node and mark it as dirty
            if (!DeepEquals.deepEquals(node.getData(), entity))
            {
                node.setDirty(true);
            }
            else if (node.isProcessed())
            {
                node.setDirty(false);
            }

            node.setData(entity);

            // If node is NOT in managed state, its data needs to be
            // replaced with the one provided in entity object
        }

        // Put this node into object graph
        graph.addNode(nodeId, node);

        // Iterate over relations and construct children nodes
        for (Relation relation : entityMetadata.getRelations())
        {
            if (relation != null)
            {
                // Child Object set in this entity
                Object childObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());

                if (childObject != null && !ProxyHelper.isProxy(childObject))
                {
                    EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(pd.getKunderaMetadata(),
                            PropertyAccessorHelper.getGenericClass(relation.getProperty()));

                    if (metadata != null && relation.isJoinedByPrimaryKey())
                    {
                        PropertyAccessorHelper.setId(childObject, metadata,
                                PropertyAccessorHelper.getId(entity, entityMetadata));
                    }
                    // This child object could be either an entity(1-1 or M-1)
                    // or a
                    // collection/ Map of entities(1-M or M-M)
                    if (Collection.class.isAssignableFrom(childObject.getClass()))
                    {
                        // For each entity in the collection, construct a child
                        // node and add to graph
                        Collection childrenObjects = (Collection) childObject;

                        if (childrenObjects != null && !ProxyHelper.isProxyCollection(childrenObjects))

                            for (Object childObj : childrenObjects)
                            {
                                if (childObj != null)
                                {
                                    addChildNodesToGraph(graph, node, relation, childObj,
                                            metadata != null ? getChildNodeState(metadata, childObj) : initialNodeState);
                                }
                            }
                    }
                    else if (Map.class.isAssignableFrom(childObject.getClass()))
                    {
                        Map childrenObjects = (Map) childObject;
                        if (childrenObjects != null && !ProxyHelper.isProxyCollection(childrenObjects))
                        {
                            for (Map.Entry entry : (Set<Map.Entry>) childrenObjects.entrySet())
                            {
                                addChildNodesToGraph(graph, node, relation, entry,
                                        metadata != null ? getChildNodeState(metadata, entry) : initialNodeState);
                            }
                        }
                    }
                    else
                    {
                        // Construct child node and add to graph
                        addChildNodesToGraph(graph, node, relation, childObject,
                                metadata != null ? getChildNodeState(metadata, childObject) : initialNodeState);
                    }
                }
            }
        }

        // Means compelte graph is build.
        node.setGraphCompleted(true);
        return node;
    }
1298038
@ExportInstanceMethod
	public static String getType(GeometryIndex instance) {
		switch (instance.getType()) {
			case TYPE_GEOMETRY:
				return "geometry";
			case TYPE_VERTEX:
				return "vertex";
			case TYPE_EDGE:
				return "edge";
			default:
				return "unknown";
		}
	}
1304199
public static Scriptable getObjectPrototype(Scriptable scope) {
        return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
                TopLevel.Builtins.Object);
    }
771077
@SuppressWarnings("unchecked")
	public DomainObjectMatch<T> ELEMENTS(TerminalResult...  where) {
		DomainObjectMatch<T> ret;
		// all where expressions have already been added to the astObjects list
		// of the SelectExpression
		SelectExpression<T> se = this.getSelectExpression();
		
		// create match for the true type
		DomainObjectMatch<?> selDom =APIAccess.createDomainObjectMatch(
					se.getStart().getDomainObjectType(),
				se.getQueryExecutor().getDomainObjectMatches().size(),
				se.getQueryExecutor().getMappingInfo());
		handleUnionExpressions(se);
		se.getQueryExecutor().getDomainObjectMatches().add(selDom);
		se.resetAstObjectsContainer();
		se.setEnd(selDom);
		if (se.isReject()) {
			Boolean br_old = QueryRecorder.blockRecording.get();
			try {
				QueryRecorder.blockRecording.set(Boolean.TRUE);
				// remove it from the return statement
				// it is only temporary
				APIAccess.setPartOfReturn(selDom, false);
				AbstractDomainQuery q = se.getDomainQuery();
				DomainObjectMatch<?> rejectDom = InternalAccess.createMatch(q, se.getStart().getDomainObjectType());
				// build complementary set
				q.WHERE(rejectDom).IN(se.getStart());
				q.WHERE(rejectDom).NOT().IN(selDom);
				selDom = rejectDom;
			} finally {
				QueryRecorder.blockRecording.set(br_old);
			}
		}
		if (se.getStartType().equals(DomainObject.class)) // generic domain object match
			ret = APIAccess.createDomainObjectMatch(se.getStartType(), selDom);
		else
			ret = (DomainObjectMatch<T>) selDom;
		Object[] placeHolders = null;
		if (where != null) {
			placeHolders = new QueryRecorder.PlaceHolder[where.length];
			for (int i = 0; i < where.length; i++) {
				placeHolders[i] = QueryRecorder.placeHolder(where[i]);
			}
		}
		DomainObjectMatch<?> delegate = APIAccess.getDelegate(ret);
		DomainObjectMatch<?> match = delegate != null ? delegate : ret;
		if (placeHolders != null)
			QueryRecorder.recordStackedAssignment(this, "ELEMENTS", match, placeHolders);
		else
			QueryRecorder.recordStackedAssignment(this, "ELEMENTS", match);
		return ret;
	}
207961
public <T> DomainObjectMatch<T> createMatch(Class<T> domainObjectType) {
		DomainObjectMatch<T> ret = createMatchInternal(domainObjectType);
		QueryRecorder.recordAssignment(this, "createMatch", ret,
				QueryRecorder.literal(domainObjectType.getName()));
		return ret;
	}
1067703
static ObjectName createObjectName(final String domain, final PathAddress pathAddress) {
        return createObjectName(domain, pathAddress, null);
    }
1251595
protected EndpointType getType(String pathType) {
		if (tc.isDebugEnabled()) {
			Tr.debug(tc, "Path type is " + pathType);
		}
		return EndpointType.valueOf(pathType);
	}
957272
public static ObjectName createObjectName(String domain, String type) {
        try {
            return new ObjectName(domain + ":type=" + type);
        } catch(MalformedObjectNameException e) {
            throw new VoldemortException(e);
        }
    }
919610
public Class typeFromObjectTypeId(final String objectTypeId, final BaseTypeId defaultType, final Class defaultClass) {

		// default for cmuis:folder
		if (defaultType.value().equals(objectTypeId)) {
			return defaultClass;
		}

		return StructrApp.getConfiguration().getNodeEntityClass(objectTypeId);
	}
572285
static final String getPayloadAsType(int typeInfo, ConstantPool pool) {
    if (getTag(typeInfo) == OBJECT_TAG) {
      return (String) pool.getConstantData(getPayload(typeInfo));
    }
    throw new IllegalArgumentException("expecting object type");
  }