code: private Attribute checkContext(URI type, URI id, URI issuer,
                                          URI category, int designatorType) {
          if (!STRING_ATTRIBUTE_TYPE_URI.equals(type)) return null;
          String [] values = null;
          switch(designatorType){
              case AttributeDesignator.SUBJECT_TARGET:
                  values = context.getSubjectValues(id.toString());
                  break;
              case AttributeDesignator.RESOURCE_TARGET:
                  values = context.getResourceValues(id);
                  break;
              case AttributeDesignator.ACTION_TARGET:
                  values = context.getActionValues(id);
                  break;
              case AttributeDesignator.ENVIRONMENT_TARGET:
                  values = context.getEnvironmentValues(id);
                  break;
          }
          if (values == null || values.length == 0) return null;
          String iString = (issuer == null) ? null : issuer.toString();
          String tString = type.toString();
          if (values.length == 1) {
              AttributeValue val = stringToValue(values[0], tString);
              return (val == null) ? null :
                  new SingletonAttribute(id, iString, getCurrentDateTime(), val);
          } else {
              ArrayList<AttributeValue> valCollection = new ArrayList<AttributeValue>(values.length);
              for (int i=0;i<values.length;i++) {
                  AttributeValue val = stringToValue(values[i], tString);
                  if (val != null) valCollection.add(val);
              }
              return new BasicAttribute(id, type, iString, getCurrentDateTime(), valCollection);
          }
      }
docs: Private helper that checks the request context for an attribute, or else returns
  null