code: public TypeDefinitionList getTypeChildren(
  
          String typeId,
          boolean includePropertyDefinitions,
          BigInteger maxItems,
          BigInteger skipCount) {
  
          refresh();
          TypeDefinitionListImpl result = new TypeDefinitionListImpl(new ArrayList<TypeDefinition>());
  
          int skip = (skipCount == null ? 0 : skipCount.intValue());
          if (skip < 0) {
              skip = 0;
          }
  
          int max = (maxItems == null ? Integer.MAX_VALUE : maxItems.intValue());
          if (max < 1) {
              return result;
          }
  
          if (typeId == null) {
              if (skip < 1) {
                  result.getList().add(copyTypeDefintion(m_types.get(FOLDER_TYPE_ID).getTypeDefinition()));
                  max--;
              }
              if ((skip < 2) && (max > 0)) {
                  result.getList().add(copyTypeDefintion(m_types.get(DOCUMENT_TYPE_ID).getTypeDefinition()));
                  max--;
              }
  
              result.setHasMoreItems(Boolean.valueOf((result.getList().size() + skip) < 2));
              result.setNumItems(BigInteger.valueOf(2));
          } else {
              TypeDefinitionContainer tc = m_types.get(typeId);
              if ((tc == null) || (tc.getChildren() == null)) {
                  return result;
              }
  
              for (TypeDefinitionContainer child : tc.getChildren()) {
                  if (skip > 0) {
                      skip--;
                      continue;
                  }
  
                  result.getList().add(copyTypeDefintion(child.getTypeDefinition()));
  
                  max--;
                  if (max == 0) {
                      break;
                  }
              }
  
              result.setHasMoreItems(Boolean.valueOf((result.getList().size() + skip) < tc.getChildren().size()));
              result.setNumItems(BigInteger.valueOf(tc.getChildren().size()));
          }
  
          if (!includePropertyDefinitions) {
              for (TypeDefinition type : result.getList()) {
                  type.getPropertyDefinitions().clear();
              }
          }
  
          return result;
      }
docs: Collects the children of a type.<p>
  
  @param typeId the id of the type
  @param includePropertyDefinitions true if the property definitions should be included
  @param maxItems the maximum number of items to return
  @param skipCount the number of items to skip
  
  @return the children of the type