class ProfileAttributesResolverImpl implements ProfileAttributesResolver {

    @Override
    public boolean isParametrizedResource(Object resource, ProfileAttributeCategory... categories) {
        try {
            OutputStream outputStream = new ByteArrayOutputStream();
            objectMapper.writeValue(outputStream, resource);
            String outputStreamStr = outputStream.toString();

            Scanner scanner = new Scanner(outputStreamStr);
            String foundAttribute;
            boolean hasAttributes = false;
            while ((foundAttribute = scanner.findInLine(compiledParametrizedResourcePattern)) != null || scanner.hasNextLine()) {
                if (foundAttribute == null) {
                    scanner.nextLine();
                    continue;

                }

                MatchResult matchResult = scanner.match();
                String foundCategory = matchResult.group(3);
                ProfileAttributeCategory attrCategory = ProfileAttributeCategory.HIERARCHICAL;

                if (foundCategory != null) {
                    try {
                        attrCategory = ProfileAttributeCategory.valueOf(foundCategory.toUpperCase());
                    } catch (IllegalArgumentException e) {
                        continue;
                    }
                }
                hasAttributes = true;

                if (categories != null) {
                    for (ProfileAttributeCategory category : categories) {
                        if (!category.equals(attrCategory)) {
                            return false;
                        }
                    }
                } else {
                    return true;
                }
            }

            return hasAttributes;
        } catch (IOException e) {
            throw new JSException(e.toString());
        }
    }

    public  ProfileAttributesResolverImpl();

}