retrieves the primary type of the resources node; is using the 'getPrimaryType()' method
if the wrapped resource is a JcrResource.
2988
@Override
    public String getPrimaryType() {
        return resource instanceof JcrResource
                ? ((JcrResource) resource).getPrimaryType()
                : getProperty(JcrConstants.JCR_PRIMARYTYPE);
    }
868698
JcrNodeType getNodeType( Name nodeTypeName ) {
        JcrNodeType nodeType = nodeTypes().getNodeType(nodeTypeName);

        if (nodeType != null) {
            nodeType = nodeType.with(context(), session);
        }

        return nodeType;
    }
929011
public static Class getWrapperType(Class primitiveType) {
        if (primitiveType.isPrimitive()) {
            return PRIMITIVES_TO_WRAPPERS.get(primitiveType);
        }
        return primitiveType;
    }
1125465
public I_CmsResourceType getResourceType() {

        if (m_resourceType == null) {
            m_resourceType = OpenCms.getResourceManager().getResourceType(m_resource);
        }
        return m_resourceType;
    }
561352
private static Resource getAutoDetectedResourceType() {
    if (System.getenv("GAE_INSTANCE") != null) {
      return Resource.GaeAppFlex;
    }
    if (System.getenv("KUBERNETES_SERVICE_HOST") != null) {
      return Resource.Container;
    }
    if (ServiceOptions.getAppEngineAppId() != null) {
      return Resource.GaeAppStandard;
    }
    if (MetadataConfig.getInstanceId() != null) {
      return Resource.GceInstance;
    }
    // default Resource type
    return Resource.Global;
  }
773991
public ResourceRefType<ApplicationType<T>> getOrCreateResourceRef()
   {
      List<Node> nodeList = childNode.get("resource-ref");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ResourceRefTypeImpl<ApplicationType<T>>(this, "resource-ref", childNode, nodeList.get(0));
      }
      return createResourceRef();
   }
504958
@Override
	@Description("Gets all of th resource types which have bound Component Bindings Providers")
	public String[] getLoadedResourceTypes() {
		Set<String> types = ((ComponentBindingsProviderFactoryImpl) componentBindingsProviderFactory)
				.getLoadedResourceTypes();
		return types.toArray(new String[types.size()]);
	}
400698
def get_resource_type_from_included_serializer(self):
        
        field_name = self.field_name or self.parent.field_name
        parent = self.get_parent_serializer()

        if parent is not None:
            # accept both singular and plural versions of field_name
            field_names = [
                inflection.singularize(field_name),
                inflection.pluralize(field_name)
            ]
            includes = get_included_serializers(parent)
            for field in field_names:
                if field in includes.keys():
                    return get_resource_type_from_serializer(includes[field])

        return None
45465
public static String getResourceType(Class<? extends BoxResource> clazz) {
        BoxResourceType resource = clazz.getAnnotation(BoxResourceType.class);
        if (resource == null) {
            throw new IllegalArgumentException("Provided BoxResource type does not have @BoxResourceType annotation.");
        }
        return resource.value();
    }
514427
public ResolvableType getComponentType() {
        if (this == NONE) {
            return NONE;
        }
        if (this.componentType != null) {
            return this.componentType;
        }
        if (this.type instanceof Class) {
            Class<?> componentType = ((Class<?>) this.type).getComponentType();
            return forType(componentType, this.variableResolver);
        }
        if (this.type instanceof GenericArrayType) {
            return forType(((GenericArrayType) this.type).getGenericComponentType(), this.variableResolver);
        }
        return resolveType().getComponentType();
    }
300561
public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
   {
      EntityCollection ec = new EntityCollection();
      NodeTypeIterator allTypes = getAllNodeTypes();
      while (allTypes.hasNext())
      {
         NodeType type = allTypes.nextNodeType();
         if (!type.isMixin())
         {
            ec.add(type);
         }
      }
      return ec;
   }
401336
private String getProviderName(String resourceType) {

        CmsDebugLog.consoleLog("getProviderName for " + resourceType);
        for (CmsResourceTypeBean typeBean : m_dialogBean.getTypes()) {
            if (typeBean.getType().equals(resourceType)) {
                return typeBean.getPreviewProviderName();
            }
        }
        return null;
    }
939887
public int getJcrType( PropertyType propertyType ) {
        switch (propertyType) {
            case BOOLEAN:
                return javax.jcr.PropertyType.BOOLEAN;
            case DATETIME:
                return javax.jcr.PropertyType.DATE;
            case DECIMAL:
                return javax.jcr.PropertyType.DECIMAL;
            case HTML:
                return javax.jcr.PropertyType.STRING;
            case INTEGER:
                return javax.jcr.PropertyType.LONG;
            case URI:
                return javax.jcr.PropertyType.URI;
            case ID:
                return javax.jcr.PropertyType.STRING;
            default:
                return javax.jcr.PropertyType.UNDEFINED;
        }
    }
1289117
public String getSchemaNodeSourceType() {

		final SchemaNode sourceNode = getSourceNode();
		if (sourceNode != null) {

			return sourceNode.getProperty(SchemaNode.name);
		}

		return null;
	}
228394
public static Stream<String> getResourceTypes(final Event event) {
        if (event instanceof org.modeshape.jcr.api.observation.Event) {
            try {
                final org.modeshape.jcr.api.observation.Event modeEvent =
                        (org.modeshape.jcr.api.observation.Event) event;
                final Stream.Builder<NodeType> types = Stream.builder();
                for (final NodeType type : modeEvent.getMixinNodeTypes()) {
                    types.add(type);
                }
                types.add(modeEvent.getPrimaryNodeType());
                return types.build().map(NodeType::getName);
            } catch (final RepositoryException e) {
                throw new RepositoryRuntimeException(e);
            }
        }
        return empty(); // wasn't a ModeShape event, so we have no access to resource types
    }
607903
public String getTreeResource(String type) {

        String result = m_treeType.get(type);
        if (result == null) {
            result = "/";
        }
        return result;
    }
1077068
def get_node_type(self, node, parent=None):
        
        if isinstance(node, CompositeDocument):
            return 'composite-page'
        elif isinstance(node, (Document, DocumentPointer)):
            return 'page'
        elif isinstance(node, Binder) and parent is None:
            return 'book'
        for child in node:
            if isinstance(child, TranslucentBinder):
                return 'unit'
        return 'chapter'