/* (non-Javadoc)
@see org.deckfour.xes.model.factory.XModelFactory#createAttributeLiteral(java.lang.String, java.lang.String, org.deckfour.xes.extension.XExtension)
353516
public XAttributeLiteral createAttributeLiteral(String key, String value,
			XExtension extension) {
		return new XAttributeLiteralImpl(intern(key), intern(value), extension);
	}
141900
static <T> T getAnnotationAttribute(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, T defaultValue,
			OnAnnotationAttributeListener<T> listener) {
		String attributeResult;

		ModelAnnotation item = model.getAnnotation(annotation);
		if (item != null) {
			attributeResult = item.getAttribute(attribute);

			return listener.onFound(attributeResult);
		}

		return defaultValue;
	}
419979
public List<OpenIDAttribute> createAttributeList(String identifier) {
		List<OpenIDAttribute> list = new LinkedList<>();
		if (identifier != null && identifier.matches("https://www.google.com/.*")) {
			OpenIDAttribute email = new OpenIDAttribute("email", "http://axschema.org/contact/email");
			OpenIDAttribute first = new OpenIDAttribute("firstname", "http://axschema.org/namePerson/first");
			OpenIDAttribute last = new OpenIDAttribute("lastname", "http://axschema.org/namePerson/last");
			email.setCount(1);
			email.setRequired(true);
			first.setRequired(true);
			last.setRequired(true);
			list.add(email);
			list.add(first);
			list.add(last);
		}
		return list;
	}
499832
@Override
    protected Object getAttributeLocally(int designatorType,
                                         URI attributeId,
                                         URI resourceCategory,
                                         EvaluationCtx context) {
                return null;

    }
468197
public String generateUpdateExpressionAndUpdateAttributeMaps(Map<String, String> expressionAttributeNamesMap,
                                                                 Map<String, AttributeValue> expressionsAttributeValuesMap,
                                                                 Map<String, AttributeValue> nonKeyNonNullAttributeValueMap,
                                                                 List<String> nullValuedNonKeyAttributeNames) {
        StringBuilder updateExpressionSetBuilder = new StringBuilder();
        StringBuilder updateExpressionDeleteBuilder = new StringBuilder();

        // This has to be a sorted list to ensure deterministic retrieval order for nonKeyNonNullAttributes
        // while auto generating update expression tokens
        List<String> sortedNonKeyNonNullAttributeNames = new ArrayList<String>(nonKeyNonNullAttributeValueMap.keySet());
        Collections.sort(sortedNonKeyNonNullAttributeNames);

        // Sort the null valued non-key attributes to ensure deterministic retrieval order for nullValuedNonKeyAttributes
        // while auto generating update expression tokens
        List<String> sortedNullValuedNonKeyAttributeNames = new ArrayList<String>(nullValuedNonKeyAttributeNames);
        Collections.sort(sortedNullValuedNonKeyAttributeNames);


        // Initialize baseToken and suffixCounter for each update item
        String baseToken = getBaseToken(sortedNonKeyNonNullAttributeNames, sortedNullValuedNonKeyAttributeNames);
        Long suffixCounter = 0L;
        if (sortedNonKeyNonNullAttributeNames.size() > 0) {
            updateExpressionSetBuilder.append("SET ");
            List<String> updateStringSetExpressions = new ArrayList<String>();
            for (String nonKeyAttributeName : sortedNonKeyNonNullAttributeNames) {
                String tokenBase = generateSubstitutionTokenString(baseToken,
                                                                   suffixCounter,
                                                                   expressionAttributeNamesMap.keySet(),
                                                                   expressionsAttributeValuesMap.keySet());
                suffixCounter++;
                String tokenKeyName = getExpressionAttributeNameSubstitutionToken(tokenBase);
                String tokenValueName = getExpressionAttributeValueSubstitutionToken(tokenBase);
                expressionAttributeNamesMap.put(tokenKeyName, nonKeyAttributeName);
                expressionsAttributeValuesMap.put(tokenValueName, nonKeyNonNullAttributeValueMap.get(nonKeyAttributeName));
                updateStringSetExpressions.add(tokenKeyName + " = " + tokenValueName);
            }
            for (int i = 0; i < updateStringSetExpressions.size() - 1; i++) {
                updateExpressionSetBuilder.append(updateStringSetExpressions.get(i) + ", ");
            }
            updateExpressionSetBuilder.append(updateStringSetExpressions.get(updateStringSetExpressions.size() - 1));

        }
        if (sortedNullValuedNonKeyAttributeNames.size() > 0) {
            updateExpressionDeleteBuilder.append("REMOVE ");
            List<String> updateStringDeleteExpressions = new ArrayList<String>();
            for (String nullAttributeName : sortedNullValuedNonKeyAttributeNames) {
                String tokenBaseString = generateSubstitutionTokenString(baseToken,
                                                                         suffixCounter,
                                                                         expressionAttributeNamesMap.keySet());
                suffixCounter++;
                String tokenKeyName = getExpressionAttributeNameSubstitutionToken(tokenBaseString);
                expressionAttributeNamesMap.put(tokenKeyName, nullAttributeName);
                updateStringDeleteExpressions.add(tokenKeyName);
            }
            for (int i = 0; i < updateStringDeleteExpressions.size() - 1; i++) {
                updateExpressionDeleteBuilder.append(updateStringDeleteExpressions.get(i) + ", ");
            }
            updateExpressionDeleteBuilder.append(updateStringDeleteExpressions.get(updateStringDeleteExpressions.size() - 1));
        }
        StringBuilder updateExpression = new StringBuilder();
        if (updateExpressionSetBuilder.length() > 0) {
            updateExpression.append(updateExpressionSetBuilder.toString());
        }
        if (updateExpressionDeleteBuilder.length() > 0) {
            updateExpression.append(" " + updateExpressionDeleteBuilder.toString());
        }

        return updateExpression.toString();
    }
800807
protected Map<String, Object> createMessageModel(String attributeName, Object attributeValue) {
        Map<String, Object> model = new HashMap<>(1);
        model.put(attributeName, attributeValue);

        return model;
    }
71820
private void addInPredicateToBuilder(KuduScannerBuilder scannerBuilder, ListIterator<Expression> inIter,
            Attribute attribute)
    {
        List<Object> finalVals = new ArrayList<>();
        Type type = KuduDBValidationClassMapper.getValidTypeForClass(((Field) attribute.getJavaMember()).getType());
        ColumnSchema column = new ColumnSchema.ColumnSchemaBuilder(((AbstractAttribute) attribute).getJPAColumnName(),
                type).build();
        while (inIter.hasNext())
        {
            String val = inIter.next().toActualText();
            finalVals.add(KuduDBDataHandler.parse(type, val));
        }
        scannerBuilder.addPredicate(KuduDBDataHandler.getInPredicate(column, finalVals));
    }
1089859
protected XMLObject newAttributeValue(final Object value, final String valueType, final QName elementName) {

        if (XSString.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSStringBuilder();
            val attrValueObj = builder.buildObject(elementName, XSString.TYPE_NAME);
            attrValueObj.setValue(value.toString());
            return attrValueObj;
        }

        if (XSURI.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSURIBuilder();
            val attrValueObj = builder.buildObject(elementName, XSURI.TYPE_NAME);
            attrValueObj.setValue(value.toString());
            return attrValueObj;
        }

        if (XSBoolean.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSBooleanBuilder();
            val attrValueObj = builder.buildObject(elementName, XSBoolean.TYPE_NAME);
            attrValueObj.setValue(XSBooleanValue.valueOf(value.toString().toLowerCase()));
            return attrValueObj;
        }

        if (XSInteger.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSIntegerBuilder();
            val attrValueObj = builder.buildObject(elementName, XSInteger.TYPE_NAME);
            attrValueObj.setValue(Integer.valueOf(value.toString()));
            return attrValueObj;
        }

        if (XSDateTime.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSDateTimeBuilder();
            val attrValueObj = builder.buildObject(elementName, XSDateTime.TYPE_NAME);
            attrValueObj.setValue(DateTime.parse(value.toString()));
            return attrValueObj;
        }

        if (XSBase64Binary.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val builder = new XSBase64BinaryBuilder();
            val attrValueObj = builder.buildObject(elementName, XSBase64Binary.TYPE_NAME);
            attrValueObj.setValue(value.toString());
            return attrValueObj;
        }

        if (XSObject.class.getSimpleName().equalsIgnoreCase(valueType)) {
            val mapper = new JacksonXmlSerializer();
            val builder = new XSAnyBuilder();
            val attrValueObj = builder.buildObject(elementName);
            attrValueObj.setTextContent(mapper.writeValueAsString(value));
            return attrValueObj;
        }

        val builder = new XSAnyBuilder();
        val attrValueObj = builder.buildObject(elementName);
        attrValueObj.setTextContent(value.toString());
        return attrValueObj;
    }
169509
function () {
    this.attEltNodes=null;
    this._attGenerators=null;

    // determine the possible template attribute names
    var tpAttNames={}, ca=this.ctlAttributes, defaultTplAtt=null, lastTplAtt=null, count=0;
    for (var k in ca) {
      if (ca.hasOwnProperty(k) && ca[k].type==="template") {
        // k is defined in the controller attributes collection
        // so k is a valid template attribute name
        tpAttNames[k]=true;
        count++;
        if (ca[k].defaultContent) {
          defaultTplAtt=k;
        }
        lastTplAtt=k;
      }
    }

    // if there is only one template attribute it will be automatically considered as default
    if (!defaultTplAtt) {
      if (count===1) {
        defaultTplAtt=lastTplAtt;
      } else if (count>1) {
        // error: a default must be defined
        log.error(this+" A default content element must be defined when multiple content elements are supported");
        // use last as default
        defaultTplAtt=lastTplAtt;
      }
    }

    // check if a default attribute element has to be created and create it if necessary
    this.manageDefaultAttElt(defaultTplAtt);

    // Analyze node attributes to see if a template attribute is passed as text attribute
    var atts=this.atts, att, nm;
    if (atts) {
      for (var k in atts) {
        if (!atts.hasOwnProperty(k)) continue;
        att=atts[k];
        nm=att.name;
        if (tpAttNames[nm]) {
          // nm is a template attribute passed as text attribute
          if (this.tplAttributes && this.tplAttributes[nm]) {
            // already defined: raise an error

            log.error(this+" Component attribute '" + nm + "' is defined multiple times - please check");
          } else {
            // create new tpl Attribute Text Node and add it to the tplAttributes collection
            if (!att.generator) {
              var txtNode;
              if (att.value) {
                // static value
                txtNode = new $TextNode(0,[""+att.value]);
              } else {
                // dynamic value using expressions
                txtNode = new $TextNode(this.exps,atts[k].textcfg);
              }
              if (!this._attGenerators) {
                this._attGenerators = [];
              }
              att.generator = new $CptAttElement(nm,0,0,0,[txtNode]); // name, exps, attcfg, ehcfg, children
              this._attGenerators.push(att.generator);
            }
            // generate a real $CptAttElement using the TextNode as child element
            var ni=att.generator.createNodeInstance(this);
            ni.isCptContent=true;
            if (!this.attEltNodes) {
              this.attEltNodes=[];
            }
            this.attEltNodes.push(ni);
            // attribute elements will automatically register through registerAttElement()
          }
        }
      }
    }

    this.retrieveAttElements();
  }
344573
public TldAttributeType<TagType<T>> getOrCreateAttribute()
   {
      List<Node> nodeList = childNode.get("attribute");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new TldAttributeTypeImpl<TagType<T>>(this, "attribute", childNode, nodeList.get(0));
      }
      return createAttribute();
   }
68466
@Override
    protected LogicalFilterWrapper appendAttributeToQuery(LogicalFilterWrapper queryBuilder, final String dataAttribute, final List<Object> queryValues) {
        if (queryBuilder == null) {
            queryBuilder = new LogicalFilterWrapper(this.queryType);
        }

        for (final Object queryValue : queryValues) {
            final String queryValueString = queryValue == null ? null : queryValue.toString();

            if (StringUtils.isNotBlank(queryValueString)) {
                final Filter filter;
                if (!queryValueString.contains("*")) {
                    filter = new EqualsFilter(dataAttribute, queryValueString);
                } else {
                    filter = new LikeFilter(dataAttribute, queryValueString);
                }

                queryBuilder.append(filter);
            }
        }

        return queryBuilder;
    }
289911
static function createExtendedAttributeFilterSQLStrings( &$extendedAttributeFilter )
    {
        $filter = array( 'tables'   => '',
                         'joins'    => '',
                         'columns'  => '',
                         'group_by' => '' );

        if ( $extendedAttributeFilter and count( $extendedAttributeFilter ) > 1 )
        {
            $extendedAttributeFilterID      = $extendedAttributeFilter['id'];
            $extendedAttributeFilterParams  = $extendedAttributeFilter['params'];
            $filterINI                      = eZINI::instance( 'extendedattributefilter.ini' );

            if ( !$filterINI->hasGroup( $extendedAttributeFilterID ) )
            {
                eZDebug::writeError( "Unable to find configuration for the extended attribute filter '$extendedAttributeFilterID', the filter will be ignored", __METHOD__ );
                return $filter;
            }

            $filterClassName    = $filterINI->variable( $extendedAttributeFilterID, 'ClassName' );
            $filterMethodName   = $filterINI->variable( $extendedAttributeFilterID, 'MethodName' );

            if ( $filterINI->hasVariable( $extendedAttributeFilterID, 'FileName' ) )
            {
                $filterFile = $filterINI->variable( $extendedAttributeFilterID, 'FileName' );

                if ( $filterINI->hasVariable( $extendedAttributeFilterID, 'ExtensionName' ) )
                {
                    $extensionName = $filterINI->variable( $extendedAttributeFilterID, 'ExtensionName' );
                    include_once( eZExtension::baseDirectory() . "/$extensionName/$filterFile" );
                }
                else
                {
                    include_once( $filterFile );
                }
            }

            if ( !class_exists( $filterClassName, true ) )
            {
                eZDebug::writeError( "Unable to find the PHP class '$filterClassName' associated with the extended attribute filter '$extendedAttributeFilterID', the filter will be ignored", __METHOD__ );
                return $filter;
            }

            $classObject        = new $filterClassName();
            $parameterArray     = array( $extendedAttributeFilterParams );

            $sqlResult          = call_user_func_array( array( $classObject, $filterMethodName ), $parameterArray );

            $filter['tables']   = $sqlResult['tables'];
            $filter['joins']    = $sqlResult['joins'];
            $filter['columns']  = isset( $sqlResult['columns'] ) ? $sqlResult['columns'] : '';

            if( isset( $sqlResult['group_by'] ) )
                $filter['group_by'] =  $sqlResult['group_by'];
        }

        return $filter;
    }
1368412
public void setObjectAttributeList(java.util.Collection<AttributeKeyAndValue> objectAttributeList) {
        if (objectAttributeList == null) {
            this.objectAttributeList = null;
            return;
        }

        this.objectAttributeList = new java.util.ArrayList<AttributeKeyAndValue>(objectAttributeList);
    }
955407
private static void addAttribute(Element element, Set<Attr> attributes, Object value) {
		Attr attr = (Attr) value;
		if (!attributes.add(attr)) {
			throw new TemplateException("Invalid element |%s|. It has both static attribute |%s| and attribute operator.", element, attr.getName());
		}
	}
1296795
public static Attribute<?> createEmptyAttribute(AbstractAttributeInfo attrInfo) {
		if (attrInfo instanceof PrimitiveAttributeInfo) {
			return createEmptyPrimitiveAttribute((PrimitiveAttributeInfo) attrInfo);
		} else if (attrInfo instanceof AssociationAttributeInfo) {
			return createEmptyAssociationAttribute((AssociationAttributeInfo) attrInfo);
		}
		return null;
	}
1345747
public MMAXAttribute getAttributeList(int i) {
    if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
      jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFeatCode_attributeList), i);
    return (MMAXAttribute)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFeatCode_attributeList), i)));}
982602
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Map<String, AttributeValue> createAttributeMap(Data data) {
    Map<String, AttributeValue> attributeMap = new HashMap<>(data.size);
    for (int i = 0; i < data.size; i++) {
      attributeMap.put(data.attributeKeys[i], data.attributeValues[i]);
    }
    return attributeMap;
  }