Create an instance of {@link Project.Storepoints.Storepoint.ActivityCodes.Code.Value }
488392
public Project.Storepoints.Storepoint.ActivityCodes.Code.Value createProjectStorepointsStorepointActivityCodesCodeValue()
   {
      return new Project.Storepoints.Storepoint.ActivityCodes.Code.Value();
   }
630485
public Project.Storepoints.Storepoint.Activities.Activity createProjectStorepointsStorepointActivitiesActivity()
   {
      return new Project.Storepoints.Storepoint.Activities.Activity();
   }
981096
protected AssociationValue createInstance() {
		Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
		for (AbstractAttributeInfo attrInfo : featureInfo.getAttributes()) {
			if (attrInfo instanceof PrimitiveAttributeInfo) {
				attributes.put(attrInfo.getName(), AttributeUtil.createEmptyPrimitiveAttribute(
						(PrimitiveAttributeInfo) attrInfo));
			} else if (attrInfo instanceof AssociationAttributeInfo) {
				AssociationAttributeInfo assocInfo = (AssociationAttributeInfo) attrInfo;
				switch (assocInfo.getType()) {
					case MANY_TO_ONE:
						attributes.put(assocInfo.getName(), new ManyToOneAttribute());
						break;
					case ONE_TO_MANY:
						OneToManyAttribute oneToMany = new OneToManyAttribute();
						oneToMany.setValue(new ArrayList<AssociationValue>());
						attributes.put(assocInfo.getName(), oneToMany);
						break;
					default:
						throw new IllegalStateException("Don't know how to handle association type " +
								assocInfo.getType());
				}
			}
		}
		AssociationValue value = new AssociationValue();
		value.setAllAttributes(attributes);
		value.setId(AttributeUtil.createEmptyPrimitiveAttribute(featureInfo.getIdentifier()));
		return value;
	}
857456
@Override
    public ElementOperator<PlainDate> newValue(V value) {

        return new DateOperator(this, ElementOperator.OP_NEW_VALUE, value);

    }
120594
public static AnyValueMap fromValue(Object value) {
		AnyValueMap result = new AnyValueMap();
		result.setAsObject(value);
		return result;
	}
1372948
@NonNull
    @Override
    public MutableArray addValue(Object value) {
        synchronized (lock) {
            internalArray.append(Fleece.toCBLObject(value));
            return this;
        }
    }
1199132
public Project.OutlineCodes.OutlineCode.Values.Value createProjectOutlineCodesOutlineCodeValuesValue()
   {
      return new Project.OutlineCodes.OutlineCode.Values.Value();
   }
307983
public static JCalValue object(ListMultimap<String, Object> value) {
		Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>();
		for (Map.Entry<String, List<Object>> entry : value) {
			String key = entry.getKey();
			List<Object> list = entry.getValue();

			JsonValue v;
			if (list.size() == 1) {
				v = new JsonValue(list.get(0));
			} else {
				List<JsonValue> array = new ArrayList<JsonValue>(list.size());
				for (Object element : list) {
					array.add(new JsonValue(element));
				}
				v = new JsonValue(array);
			}
			object.put(key, v);
		}
		return new JCalValue(new JsonValue(object));
	}
910444
private void generateOnCreate(String dataSourceNameClazz) {
		MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("onCreate").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Boolean.TYPE);

		methodBuilder.addJavadoc("<p>Create datasource and open database in read mode.</p>\n");
		methodBuilder.addJavadoc("\n");
		methodBuilder.addJavadoc("@see android.content.ContentProvider#onCreate()\n");

		methodBuilder.beginControlFlow("if ($T.getContext()==null)", KriptonLibrary.class);
		methodBuilder.addStatement("KriptonLibrary.init(getContext())");
		methodBuilder.endControlFlow();
		methodBuilder.addStatement("dataSource = $L.getInstance()", dataSourceNameClazz);
		methodBuilder.addStatement("dataSource.openWritableDatabase()");

		methodBuilder.addCode("return true;\n");

		classBuilder.addMethod(methodBuilder.build());
	}
945967
public IsEmptyBuilder append(final Object value) {
        if(isNotEmpty()) {
            return this;
        }

        if(value == null) {
            return this;
        }

        final Class<?> clazz = value.getClass();
        if(clazz.isPrimitive()) {
            if(clazz.equals(Boolean.TYPE)) {
                return append((boolean) value);
            } else if(clazz.equals(Byte.TYPE)) {
                return append((byte) value);
            } else if(clazz.equals(Character.TYPE)) {
                return append((char) value);
            } else if(clazz.equals(Short.TYPE)) {
                return append((short) value);
            } else if(clazz.equals(Integer.TYPE)) {
                return append((int) value);
            } else if(clazz.equals(Long.TYPE)) {
                return append((long) value);
            } else if(clazz.equals(Float.TYPE)) {
                return append((float) value);
            } else if(clazz.equals(Double.TYPE)) {
                return append((double) value);
            }

        } else if(clazz.isArray()) {
            if(value instanceof boolean[]) {
                return append((boolean[]) value);
            } else if(value instanceof char[]) {
                return append((char[]) value);
            }
285117
public static AckEventType of(Values value) {
        if (value == Values.SDK_UNKNOWN) {
            throw new IllegalArgumentException("SDK_UNKNOWN cannot be used to create an AckEventType. Use the raw value to" +
                                               "create an AckEventType from a string instead");
        }
        return value == null ? null : new AckEventType(value, value.toString());
    }
875162
private ParamValueDescriptor createParamValue(ParamValueType paramValueType, Store store) {
        ParamValueDescriptor paramValueDescriptor = store.create(ParamValueDescriptor.class);
        for (DescriptionType descriptionType : paramValueType.getDescription()) {
            DescriptionDescriptor descriptionDescriptor = XmlDescriptorHelper.createDescription(descriptionType, store);
            paramValueDescriptor.getDescriptions().add(descriptionDescriptor);
        }
        paramValueDescriptor.setName(paramValueType.getParamName().getValue());
        XsdStringType paramValue = paramValueType.getParamValue();
        if (paramValue != null) {
            paramValueDescriptor.setValue(paramValue.getValue());
        }
        return paramValueDescriptor;
    }
1157283
@Override
	public void visit(SQLiteDaoDefinition value) throws Exception {
		currentDaoDefinition = value;

		// check if we need to generate or not
		if (value.getElement().getAnnotation(BindDaoMany2Many.class) != null && value.getElement().getAnnotation(BindGeneratedDao.class) == null) {
			return;
		}

		String classTableName = daoName(value);

		PackageElement pkg = elementUtils.getPackageOf(value.getElement());
		String packageName = pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString();

		AnnotationProcessorUtilis.infoOnGeneratedClasses(BindDao.class, packageName, classTableName);

		builder = TypeSpec.classBuilder(classTableName).superclass(Dao.class).addSuperinterface(typeName(value.getElement())).addModifiers(Modifier.PUBLIC);

		for (TypeName item : value.implementedInterface) {
			builder.addSuperinterface(item);
		}

		BindTypeContext context = new BindTypeContext(builder, TypeUtility.typeName(packageName, classTableName), Modifier.PRIVATE);
		String entityName = BindDataSourceSubProcessor.generateEntityName(value, value.getEntity());

		// javadoc for class
		builder.addJavadoc("<p>");
		builder.addJavadoc("\nDAO implementation for entity <code>$L</code>, based on interface <code>$L</code>\n", entityName, value.getElement().getSimpleName().toString());
		builder.addJavadoc("</p>\n\n");
		JavadocUtility.generateJavadocGeneratedBy(builder);
		builder.addJavadoc(" @see $T\n", TypeUtility.className(value.getEntityClassName()));
		builder.addJavadoc(" @see $T\n", TypeUtility.className(value.getElement().getQualifiedName().toString()));
		builder.addJavadoc(" @see $T\n", BindTableGenerator.tableClassName(value, value.getEntity()));

		{
			// constructor
			MethodSpec.Builder methodBuilder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addParameter(BindDaoFactoryBuilder.generateDaoFactoryClassName(value.getParent()),
					"daoFactory");
			methodBuilder.addStatement("super(daoFactory.context())");

			if (value.hasRelations()) {
				methodBuilder.addStatement("this.daoFactory=daoFactory");
				builder.addField(BindDaoFactoryBuilder.generateDaoFactoryClassName(value.getParent()), "daoFactory", Modifier.PRIVATE);
			}

			builder.addMethod(methodBuilder.build());
		}

		// define column typeName set
		for (SQLiteModelMethod item : value.getCollection()) {
			item.accept(this);
		}

		// generate live data support methods
		if (value.hasLiveData()) {
			// method sendEvent
			{
				MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(METHOD_NAME_REGISTRY_EVENT).addModifiers(Modifier.PROTECTED).addParameter(Integer.TYPE, "affectedRows");
				methodBuilder.beginControlFlow("if (affectedRows==0)");
				methodBuilder.addStatement("return");
				methodBuilder.endControlFlow();

				methodBuilder.beginControlFlow("if (_context.isInSession())");
				methodBuilder.addStatement("_context.registrySQLEvent($T.$L)", BindDataSourceBuilder.generateDataSourceName(value.getParent()), value.daoUidName);
				methodBuilder.nextControlFlow("else");
				methodBuilder.addStatement("invalidateLiveData()");
				methodBuilder.endControlFlow();

				builder.addMethod(methodBuilder.build());
			}

			// field liveDatas
			{
				FieldSpec.Builder liveDataBuilder = FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(Collection.class),
						ParameterizedTypeName.get(ClassName.get(WeakReference.class),
								// ParameterizedTypeName.get(ClassName.get(LiveDataHandler.class),
								// WildcardTypeName.subtypeOf(Object.class)))),
								ClassName.get(LiveDataHandler.class))),
						"liveDatas").addModifiers(Modifier.STATIC)
						.initializer(CodeBlock.builder().add("new $T()", ParameterizedTypeName.get(ClassName.get(CopyOnWriteArraySet.class),
								ParameterizedTypeName.get(ClassName.get(WeakReference.class), ClassName.get(LiveDataHandler.class)))).build());
				builder.addField(liveDataBuilder.build());
			}

			// registryLiveData
			{
				// .addParameter(ParameterizedTypeName.get(ClassName.get(LiveDataHandler.class),
				// WildcardTypeName.subtypeOf(Object.class)), "value");
				MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(METHOD_NAME_REGISTRY_LIVE_DATA).addModifiers(Modifier.PROTECTED).addParameter(ClassName.get(LiveDataHandler.class),
						"value");
				methodBuilder.addStatement("liveDatas.add(new $T(value))", ParameterizedTypeName.get(ClassName.get(WeakReference.class), ClassName.get(LiveDataHandler.class)));
				builder.addMethod(methodBuilder.build());
			}

			// invalidateLiveData
			{
				// check datasource and dao package must be the same, otherwise
				// invalidate must be public

				MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(METHOD_NAME_INVALIDATE_LIVE_DATA).addJavadoc("<p>Invalidate livedata.</p>\n\n").addModifiers(Modifier.PUBLIC);
				methodBuilder.beginControlFlow("for ($T item: liveDatas)",
						ParameterizedTypeName.get(ClassName.get(WeakReference.class),
								// ParameterizedTypeName.get(ClassName.get(KriptonLiveDataManager.getInstance().getLiveDataHandlerClazz()),
								// WildcardTypeName.subtypeOf(Object.class))));
								ClassName.get(LiveDataHandler.class)));
				methodBuilder.beginControlFlow("if (item.get()!=null)");
				methodBuilder.addStatement("item.get().invalidate()");
				methodBuilder.endControlFlow();
				methodBuilder.endControlFlow();
				builder.addMethod(methodBuilder.build());
			}

		}

		// generate serializer params
		for (Entry<TypeName, String> item : currentDaoDefinition.managedParams.entrySet()) {
			BindTransformer.checkIfIsInUnsupportedPackage(item.getKey());

			ManagedPropertyPersistenceHelper.generateParamSerializer(context, item.getValue(), item.getKey(), PersistType.BYTE);
			ManagedPropertyPersistenceHelper.generateParamParser(context, item.getValue(), item.getKey(), PersistType.BYTE);
		}

		// generate subject
		if (currentDaoDefinition.getParent().generateRx) {
			ParameterizedTypeName subjectTypeName = ParameterizedTypeName.get(ClassName.get(PublishSubject.class), ClassName.get(SQLiteEvent.class));

			// subject
			MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getSubject").addModifiers(Modifier.PUBLIC);
			methodBuilder.addStatement("return subject").returns(subjectTypeName);
			builder.addMethod(methodBuilder.build());

			// subject instance
			FieldSpec.Builder fieldBuilder = FieldSpec.builder(subjectTypeName, "subject", Modifier.PRIVATE, Modifier.FINAL, Modifier.STATIC).initializer("$T.create()",
					ClassName.get(PublishSubject.class));
			builder.addField(fieldBuilder.build());
		}

		// generate prepared statement cleaner
		{

			MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("clearCompiledStatements").addModifiers(Modifier.PUBLIC, Modifier.STATIC).returns(Void.TYPE);
			for (String item : value.preparedStatementNames) {
				methodBuilder.beginControlFlow("if ($L!=null)", item);
				methodBuilder.addStatement("$L.close()", item);
				methodBuilder.addStatement("$L=null", item);
				methodBuilder.endControlFlow();
			}

			builder.addMethod(methodBuilder.build());
		}

		TypeSpec typeSpec = builder.build();

		JavaWriterHelper.writeJava2File(filer, packageName, typeSpec);
	}
1283046
private void appendValue(Object value) {
        if (value instanceof Boolean) {
            closeTag();
            append(value.toString());
        } else if (value instanceof Number) {
            closeTag();
            append(value.toString());
        } else if (value instanceof String) {
            closeTag();
            escape((String) value);
        } else if (value instanceof MwsObject) {
            ((MwsObject) value).writeFragmentTo(this);
        } else if (value instanceof Node) {
            closeTag();
            append(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof Enum) {
            closeTag();
            append(((Enum<?>) value).toString());
        } else if (value instanceof XMLGregorianCalendar) {
            closeTag();
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else {
            throw new IllegalArgumentException();
        }
    }
28731
public Value createValue(Identifier value)
   {
      if (value == null)
         return null;
      try
      {
         return new ReferenceValue(value);
      }
      catch (IOException e)
      {
         LOG.warn("Cannot create REFERENCE Value from Identifier " + value, e);
         return null;
      }
   }
1010783
private static Element createValueElement(Document document, String name,
			ConfigurableEmitter.Value value) {
		Element element = document.createElement(name);

		// void: now writes the value type
		if (value instanceof SimpleValue) {
			element.setAttribute("type", "simple");
			element.setAttribute("value", "" + value.getValue(0));
		} else if (value instanceof RandomValue) {
			element.setAttribute("type", "random");
			element
					.setAttribute("value", ""
							+ ((RandomValue) value).getValue());
		} else if (value instanceof LinearInterpolator) {
			element.setAttribute("type", "linear");
			element.setAttribute("min", ""
					+ ((LinearInterpolator) value).getMin());
			element.setAttribute("max", ""
					+ ((LinearInterpolator) value).getMax());
			element.setAttribute("active", ""
					+ ((LinearInterpolator) value).isActive());

			ArrayList curve = ((LinearInterpolator) value).getCurve();
			for (int i = 0; i < curve.size(); i++) {
				Vector2f point = (Vector2f) curve.get(i);

				Element pointElement = document.createElement("point");
				pointElement.setAttribute("x", "" + point.x);
				pointElement.setAttribute("y", "" + point.y);

				element.appendChild(pointElement);
			}
		} else {
			Log.warn("unkown value type ignored: " + value.getClass());
		}

		return element;
	}
1140824
public JsonArray add(JsonValue value) {
    if (value == null) {
      throw new NullPointerException("value is null");
    }
    values.add(value);
    return this;
  }