Extract a value from the target object using DPath expression.

@param target
@param dPath
@return
@since 0.7.1
491579
public static Optional<Object> getValueOptional(Object target, String dPath) {
        return Optional.ofNullable(getValue(target, dPath));
    }
574150
public void copy(Datastream target) {

        target.isNew = isNew;
        target.DatastreamID = DatastreamID;
        if (DatastreamAltIDs != null) {
            target.DatastreamAltIDs = new String[DatastreamAltIDs.length];
            for (int i = 0; i < DatastreamAltIDs.length; i++) {
                target.DatastreamAltIDs[i] = DatastreamAltIDs[i];
            }
        }
        target.DSFormatURI = DSFormatURI;
        target.DSMIME = DSMIME;
        target.DSControlGrp = DSControlGrp;
        target.DSInfoType = DSInfoType;
        target.DSState = DSState;
        target.DSVersionable = DSVersionable;
        target.DSVersionID = DSVersionID;
        target.DSLabel = DSLabel;
        target.DSCreateDT = DSCreateDT;
        target.DSSize = DSSize;
        target.DSLocation = DSLocation;
        target.DSLocationType = DSLocationType;
        target.DSChecksumType = DSChecksumType;
        target.DSChecksum = DSChecksum;
    }
1942
public static <T> T getFieldValue(final Object target, final String name) {
		Field field = FieldUtils.getDeclaredField(target.getClass(), name, true);

		if (field == null) {
			throw new IllegalArgumentException("Could not find field [" + name + "] on target [" + target + ']');
		}

		T result = null;
		try {
			result = (T) field.get(target);
		} catch (IllegalAccessException e) {
			throw new ImpossibleException(e);
		}
		return result;
	}
581956
protected Object extract(Object target, String property) throws Exception {
    if (errorProperties.contains(property)) return null;
    if(target instanceof Map<?,?>) return ((Map<?,?>)target).get(property);
    Object value = PropertyUtils.getProperty(target, property);
    if (value instanceof Boolean) {
      if (null == textResource) {
        return value;
      } else {
        if (Boolean.TRUE.equals(value)) return getText("common.yes", "Y");
        else return getText("common.no", "N");
      }
    } else {
      return value;
    }
  }
383173
def _extract_member(self, member, targetpath, pwd):
        
        # build the destination pathname, replacing
        # forward slashes to platform specific separators.
        # Strip trailing path separator, unless it represents the root.
        if (targetpath[-1:] in (os.path.sep, os.path.altsep)
            and len(os.path.splitdrive(targetpath)[1]) > 1):
            targetpath = targetpath[:-1]

        # don't include leading "/" from file name if present
        if member.filename[0] == '/':
            targetpath = os.path.join(targetpath, member.filename[1:])
        else:
            targetpath = os.path.join(targetpath, member.filename)

        targetpath = os.path.normpath(targetpath)

        # Create all upper directories if necessary.
        upperdirs = os.path.dirname(targetpath)
        if upperdirs and not os.path.exists(upperdirs):
            os.makedirs(upperdirs)

        if member.filename[-1] == '/':
            if not os.path.isdir(targetpath):
                os.mkdir(targetpath)
            return targetpath

        source = self.open(member, pwd=pwd)
        target = file(targetpath, "wb")
        shutil.copyfileobj(source, target)
        source.close()
        target.close()

        return targetpath
951615
public static JsonNode getValue(JsonNode node, String dPath) {
        return DPathUtils.getValue(node, dPath);
    }
519405
public static boolean deleteAll(Path targetPath) {
        debug(log, "deleteAll", targetPath);
        return JMPath.isDirectory(targetPath) ? deleteDir(targetPath)
                : delete(targetPath);
    }
846109
public static PathAddress transformAddress(final PathAddress original, final TransformationTarget target) {
        return TransformersImpl.transformAddress(original, target);
    }
141302
public JsonNode getDataAttr(String dPath) {
        Lock lock = lockForRead();
        try {
            return DPathUtils.getValue(dataJson, dPath);
        } finally {
            lock.unlock();
        }
    }
973070
public static Object getByPath(Object target, List<String> path) {
        Object obj = target;

        for (String field : path) {
            if (obj == null) {
                return null;
            }
            obj = evaluate(obj, trimType(field));
        }

        return obj;
    }
566705
public void extractAll(Path targetDir, CopyOption... options) throws IOException
    {
        if (!Files.isDirectory(targetDir))
        {
            throw new NotDirectoryException(targetDir.toString());
        }
        ensureReading();
        do
        {
            Path p = targetDir.resolve(filename);
            InputStream is = Channels.newInputStream(this);
            Files.copy(is, p, options);
            Files.setLastModifiedTime(p, lastModified);
        } while (nextInput());
    }
578553
File findSdkHome(final String path) {
        File dotCeylon = new File(path); // or some other directory
        
        File[] homes = null;
        
        if (!dotCeylon.exists()) {
            return null;
        } else {
            homes = dotCeylon.listFiles(new FilenameFilter() {
                @Override
                public boolean accept(final File dir, final String name) {
                    if (name.startsWith("ceylon-1.")) {
                        return true;
                    }
                    return false;
                }
            });
        }
        
        if (homes.length == 0) {
            return null;
        } else if (homes.length == 1 & homes[0].isDirectory()) {
            return homes[0];
        } else {
            Arrays.sort(homes);
            if (homes[homes.length - 1].isDirectory()) {
                return homes[homes.length - 1];
            } else {
                return null;
            }
        }
    }
769819
@SuppressWarnings("unchecked")
    public static <X, Y> Y getValue(X target, String propertyPath,
                                    Class<Y> valueClass) {
        return getExpression((Class<X>) target.getClass(), propertyPath,
                valueClass).getValue(target);
    }
449353
public static <T> T getValue(Object target, String dPath, Class<T> clazz) {
        if (clazz == null) {
            throw new NullPointerException("Class parameter is null!");
        }
        Object temp = getValue(target, dPath);
        return ValueUtils.convertValue(temp, clazz);
    }
521921
public static <T> Optional<T> getValueOptional(JsonNode node, String dPath, Class<T> clazz) {
        return Optional.ofNullable(getValue(node, dPath, clazz));
    }
532632
public static <T> T getValue(JsonNode node, String dPath, Class<T> clazz) {
        if (clazz == null) {
            throw new NullPointerException("Class parameter is null!");
        }
        JsonNode temp = getValue(node, dPath);
        return ValueUtils.convertValue(temp, clazz);
    }
1271667
@Override
	protected List<Object> extractValues(String thePaths, IBaseResource theResource) {
		FHIRPathEngine fp = new FHIRPathEngine(myWorkerContext);

		List<Object> values = new ArrayList<>();
		String[] nextPathsSplit = SPLIT.split(thePaths);
		for (String nextPath : nextPathsSplit) {
			List<Base> allValues;
			try {
				allValues = fp.evaluate((Base) theResource, trim(nextPath));
			} catch (FHIRException e) {
				String msg = getContext().getLocalizer().getMessage(BaseSearchParamExtractor.class, "failedToExtractPaths", nextPath, e.toString());
				throw new InternalErrorException(msg, e);
			}
			if (allValues.isEmpty() == false) {
				values.addAll(allValues);
			}
		}

		for (int i = 0; i < values.size(); i++) {
			Object nextObject = values.get(i);
			if (nextObject instanceof Extension) {
				Extension nextExtension = (Extension) nextObject;
				nextObject = nextExtension.getValue();
				values.set(i, nextObject);
			}
		}

		return values;
	}