Returns the string representation of the code that reads a primitive array property.
@param ref           The reference.
@param source        The type of the reference.
@param property      The property to read.
@return              The code.
328197
private static String readPrimitiveArrayValue(String ref, TypeDef source, Property property)  {
        StringBuilder sb = new StringBuilder();
        Method getter = getterOf(source, property);
        sb.append(indent(ref))
                .append("Arrays.stream(")
                .append("("+property.getTypeRef().toString()+")(" + ref + " instanceof Map ? ((Map)" + ref + ").getOrDefault(\"" + getterOf(source, property).getName() + "\" , " + getDefaultValue(property)+") : "+ getDefaultValue(property)+")")
            .append(".toArray(size -> new "+getter.getReturnType().toString()+"[size])");
        return sb.toString();
    }
378905
@Override
	public String interpret(String property)
	{
		try
		{
			property = Cryption.interpret(property);
			
			if(property != null && property.indexOf(Styles.DEFAULT_PREFIX) > -1)
			{
				property = Text.format(property,this.getProperties());
			}
		}
		catch (FormatException e)
		{
			throw new ConfigException("Format exception for \""+property+"\"",e);
		}
		
		return Cryption.interpret(property);
	}
1145669
def parse_property_reference(self, tup_tree):
        

        self.check_node(tup_tree, 'PROPERTY.REFERENCE', ('NAME',),
                        ('REFERENCECLASS', 'CLASSORIGIN', 'PROPAGATED'),
                        ('QUALIFIER', 'VALUE.REFERENCE'))

        value = self.list_of_matching(tup_tree, ('VALUE.REFERENCE',))

        if not value:
            value = None
        elif len(value) == 1:
            value = value[0]
        else:
            raise CIMXMLParseError(
                _format("Element {0!A} has more than one child element "
                        "'VALUE.REFERENCE' (allowed are zero or one)",
                        name(tup_tree)),
                conn_id=self.conn_id)

        attrl = attrs(tup_tree)

        qualifiers = self.list_of_matching(tup_tree, ('QUALIFIER',))

        pref = CIMProperty(attrl['NAME'],
                           value,
                           type='reference',
                           is_array=False,
                           qualifiers=qualifiers,
                           reference_class=attrl.get('REFERENCECLASS', None),
                           class_origin=attrl.get('CLASSORIGIN', None),
                           propagated=self.unpack_boolean(
                               attrl.get('PROPAGATED', 'false')),
                           embedded_object=False)

        return pref
782272
@SuppressWarnings("unchecked")
  private T readReference(Class<T> type, BufferInput<?> buffer, Serializer serializer) {
    ReferencePool<?> pool = pools.get(type);
    if (pool == null) {
      Constructor<?> constructor = constructorMap.get(type);
      if (constructor == null) {
        try {
          constructor = type.getDeclaredConstructor(ReferenceManager.class);
          constructor.setAccessible(true);
          constructorMap.put(type, constructor);
        } catch (NoSuchMethodException e) {
          throw new SerializationException("failed to instantiate reference: must provide a single argument constructor", e);
        }
      }

      pool = new ReferencePool<>(createFactory(constructor));
      pools.put(type, pool);
    }
    T object = (T) pool.acquire();
    object.readObject(buffer, serializer);
    return object;
  }
1254528
public static P<Object> propertyRef(Compare p,String columnName){
		return new RefP(p, new PropertyReference(columnName));
	}
24733
@SuppressWarnings("unchecked")
  public T getReferenceTargetElement(ModelElementInstance referenceSourceElement) {
    String identifier = getReferenceIdentifier(referenceSourceElement);
    ModelElementInstance referenceTargetElement = referenceSourceElement.getModelInstance().getModelElementById(identifier);
    if (referenceTargetElement != null) {
      try {
        return (T) referenceTargetElement;

      } catch(ClassCastException e) {
        throw new ModelReferenceException("Element " + referenceSourceElement + " references element " + referenceTargetElement + " of wrong type. "
          + "Expecting " + referenceTargetAttribute.getOwningElementType() + " got " + referenceTargetElement.getElementType());
      }
    }
    else {
      return null;
    }
  }
459212
public final Class<?> getPropertyType(String property) {
    MethodInfo info = propertyWriteMethods.get(property);
    if (null == info) return null;
    else return info.parameterTypes[0];
  }
1284137
@Override
	public Object parse(String source) throws Exception {
		Source s = sources.poll();
		final char[] chars = source.toCharArray();
		if (s == null) {
			s = new Source(chars);
		} else {
			s.set(chars);
		}
		final Object result = parseNext(s);
		if (sources.size() > Config.POOL_SIZE) {
			return result;
		}
		sources.add(s);
		return result;
	}
299544
public static String getTerm(IndexInput inTerm, Long ref) throws IOException {
    try {
      inTerm.seek(ref);
      return inTerm.readString();
    } catch (Exception e) {
      throw new IOException(e);
    }
  }
401882
private static PropertySourceGenerator getSourceGenerator(final ErrorBuffer errorBuffer, final String className, final PropertyDefinition propertyDefinition) throws FrameworkException {

		final String propertyName                                  = propertyDefinition.getPropertyName();
		final Type propertyType                                    = propertyDefinition.getPropertyType();
		final Class<? extends PropertySourceGenerator> parserClass = parserMap.get(propertyType);

		try {

			return parserClass.getConstructor(ErrorBuffer.class, String.class, PropertyDefinition.class).newInstance(errorBuffer, className, propertyDefinition);

		} catch (Throwable t) {
			logger.warn("", t);
		}

		errorBuffer.add(new InvalidPropertySchemaToken(SchemaProperty.class.getSimpleName(), propertyName, propertyName, "invalid_property_definition", "Unknow value type " + source + ", options are " + Arrays.asList(Type.values()) + "."));
		throw new FrameworkException(422, "Invalid property definition for property " + propertyDefinition.getPropertyName(), errorBuffer);
	}
495268
private static String readObjectArrayValue(String ref, TypeDef source, Property property)  {
        StringBuilder sb = new StringBuilder();
        Method getter = getterOf(source, property);
        TypeRef getterTypeRef = getter.getReturnType();
        TypeRef propertyTypeRef = property.getTypeRef();
        if (propertyTypeRef instanceof ClassRef && getterTypeRef instanceof ClassRef) {
            String nextRef = variables.pop();
            try {
                TypeDef propertyType = ((ClassRef) propertyTypeRef).getDefinition();
                TypeDef getterType = ((ClassRef) getterTypeRef).getDefinition();
                sb.append(indent(ref))
                        .append("Arrays.stream(")
                        .append("(Map[])(" + ref + " instanceof Map ? ((Map)" + ref + ").getOrDefault(\"" + getterOf(source, property).getName() + "\" , new Map[0]) : new Map[0]))")
                        //.append("("+getterType.getFullyQualifiedName()+"[])(" + ref + " instanceof Map ? ((Map)" + ref + ").getOrDefault(\"" + getterOf(source, property).getName() + "\" , new " +getterType.getFullyQualifiedName()+"[0]) : new "+ getterType.getFullyQualifiedName()+"[0]))")
                        .append(".map(").append(nextRef).append(" ->").append(convertMap(nextRef, getterType, propertyType)).append(")")
                        .append(".toArray(size-> new "+propertyType.getFullyQualifiedName()+"[size])");
            } finally {
                variables.push(nextRef);
            }
            return sb.toString();
        }
        throw new IllegalArgumentException("Expected an object property and a matching object getter!!");
    }
300221
private static String readArrayValue(String ref, TypeDef source, Property property) {
        TypeRef typeRef = property.getTypeRef();
        if (typeRef instanceof ClassRef) {
            //TODO: This needs further breakdown, to cover edge cases.
            return readObjectArrayValue(ref, source, property);
        }

        if (typeRef instanceof PrimitiveRef) {
            return readPrimitiveArrayValue(ref, source, property);
        }
        throw new IllegalStateException("Property should be either an object or a primitive.");
    }
1013987
public String getAsString(String property) {
		if (super.has(property)) {
			return get(property).getAsString();
		}
		return null;
	}
376264
@SuppressWarnings("static-method")
	public List<String> findStringValues(JvmAnnotationReference reference) {
		assert reference != null;
		final List<String> values = new ArrayList<>();
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmStringAnnotationValue) {
				for (final String strValue : ((JvmStringAnnotationValue) value).getValues()) {
					if (strValue != null) {
						values.add(strValue);
					}
				}
			}
		}
		return values;
	}
981710
def get_object_references(tb, source, max_string_length=1000):
    
    global obj_ref_regex
    referenced_attr = set()
    for line in source.split('\n'):
        referenced_attr.update(set(re.findall(obj_ref_regex, line)))
    referenced_attr = sorted(referenced_attr)
    info = []
    for attr in referenced_attr:
        v = string_variable_lookup(tb, attr)
        if v is not ValueError:
            ref_string = format_reference(v, max_string_length=max_string_length)
            info.append((attr, ref_string))
    return info
225716
private static StringBuilder displayServiceProperties(ServiceReference reference) {

        StringBuilder sb = new StringBuilder();

        for (String propertyKey : reference.getPropertyKeys()) {
            sb.append(String.format("%s = %s%n", propertyKey, reference.getProperty(propertyKey)));
        }
        if (reference.getPropertyKeys().length == 0) {
            sb.append("EMPTY");
        }

        return sb;
    }
1313349
public static <T> T convert(Object source, TypeReference<T> destType) {
        return JSON.convertValue(source, destType);
    }