本文整理汇总了Java中org.springframework.roo.project.Property类的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于org.springframework.roo.project包,在下文中一共展示了Property类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installDependencies
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* Install jackson 2 dependencies on project pom
*/
private void installDependencies() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例2: installMavenPlugins
import org.springframework.roo.project.Property; //导入依赖的package包/类
private void installMavenPlugins(String moduleName) {
final Element configuration = XmlUtils.getConfiguration(getClass());
// Add properties
List<Element> properties = XmlUtils.findElements(
"/configuration/properties/*", configuration);
for (Element property : properties) {
projectOperations.addProperty(moduleName, new Property(property));
}
// Add Plugins
List<Element> elements = XmlUtils.findElements(
"/configuration/plugins/plugin",
configuration);
for (Element element : elements) {
Plugin plugin = new Plugin(element);
projectOperations.addBuildPlugin(
moduleName, plugin);
}
}
示例3: installMavenPlugins
import org.springframework.roo.project.Property; //导入依赖的package包/类
private void installMavenPlugins(String moduleName) {
final Element configuration = XmlUtils.getConfiguration(getClass());
// Add properties
List<Element> properties = XmlUtils.findElements(
"/configuration/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(moduleName, new Property(property));
}
// Add Plugins
List<Element> elements = XmlUtils.findElements(
"/configuration/plugins/plugin",
configuration);
for (Element element : elements) {
Plugin plugin = new Plugin(element);
getProjectOperations().addBuildPlugin(
moduleName, plugin);
}
}
示例4: addAddonDependency
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void addAddonDependency() {
// Get configuration (repository and dependency) XML element
Element conf = XmlUtils.getConfiguration(this.getClass());
// Find repository elements and add them to the project
for (Element repo : XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", conf)) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", conf);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Find dependency elements and update them into the project
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", conf));
}
示例5: updatePomProperties
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* Install properties defined in external XML file
*
* @param configuration
*/
private void updatePomProperties(Element configuration) {
List<Element> addonProperties = XmlUtils.findElements(
"/configuration/gvnix/menu/properties/*", configuration);
for (Element property : addonProperties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
}
示例6: setupProjectPom
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* Update project pom: install repositories and dependencies
*/
private void setupProjectPom() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例7: updatePom
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
*
* This method updates dependencies and repositories with the added to
* configuration.xml file
*
* @param configuration
* @param moduleName
* @param projectOperations
*/
public static void updatePom(final Element configuration,
ProjectOperations projectOperations, MetadataService metadataService) {
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
projectOperations.addRepositories(
projectOperations.getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
}
示例8: getInstance
import org.springframework.roo.project.Property; //导入依赖的package包/类
public Pom getInstance(final Element root, final String pomPath,
final String moduleName) {
Validate.notBlank(pomPath, "POM's canonical path is required");
final String artifactId = XmlUtils.getTextContent(ARTIFACT_ID_XPATH,
root);
final String groupId = getGroupId(root);
final String name = XmlUtils.getTextContent(NAME_XPATH, root);
final String packaging = XmlUtils.getTextContent(PACKAGING_XPATH, root,
DEFAULT_PACKAGING);
String version = XmlUtils.getTextContent(VERSION_XPATH, root);
final String sourceDirectory = XmlUtils.getTextContent(
SOURCE_DIRECTORY_XPATH, root);
final String testSourceDirectory = XmlUtils.getTextContent(
TEST_SOURCE_DIRECTORY_XPATH, root);
final List<Dependency> dependencies = parseElements(Dependency.class,
DEPENDENCY_XPATH, root);
final List<Filter> filters = parseElements(Filter.class, FILTER_XPATH,
root);
final List<Module> modules = getModules(root, pomPath, packaging);
final List<Plugin> plugins = parseElements(Plugin.class, PLUGIN_XPATH,
root);
final List<Property> pomProperties = parseElements(Property.class,
PROPERTY_XPATH, root);
final List<Repository> pluginRepositories = parseElements(
Repository.class, PLUGIN_REPOSITORY_XPATH, root);
final List<Repository> repositories = parseElements(Repository.class,
REPOSITORY_XPATH, root);
final List<Resource> resources = parseElements(Resource.class,
RESOURCE_XPATH, root);
final String projectParentVersion = XmlUtils.getTextContent("/project/parent/version", root);
final Parent parent = getParent(pomPath, root);
if(version == null) {
version = projectParentVersion;
}
final Collection<Path> paths = getPaths(root, packaging);
return new Pom(groupId, artifactId, version, packaging, dependencies,
parent, modules, pomProperties, name, repositories,
pluginRepositories, sourceDirectory, testSourceDirectory,
filters, plugins, resources, pomPath, moduleName, paths);
}
示例9: getPropertiesExcludingValue
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* Locates any properties which match the presented property, excluding the
* value. This is useful for upgrade use cases, where it is necessary to
* locate any properties with the name so that they can be removed.
*
* @param property to locate (required; note the value is ignored in
* comparisons)
* @return any matching properties (never returns null, but may return an
* empty {@link Set})
*/
public Set<Property> getPropertiesExcludingValue(final Property property) {
Validate.notNull(property, "Property to locate is required");
final Set<Property> result = new HashSet<Property>();
for (final Property p : pomProperties) {
if (property.getName().equals(p.getName())) {
result.add(p);
}
}
return result;
}
示例10: getProperty
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* Locates the first occurrence of a property for a given name and returns
* it.
*
* @param name the property name (required)
* @return the property if found otherwise null
*/
public Property getProperty(final String name) {
Validate.notBlank(name, "Property name to locate is required");
for (final Property p : pomProperties) {
if (name.equals(p.getName())) {
return p;
}
}
return null;
}
示例11: updatePomProperties
import org.springframework.roo.project.Property; //导入依赖的package包/类
private void updatePomProperties(final Element configuration,
final String moduleName) {
final List<Element> databaseProperties = XmlUtils.findElements(
"/configuration/spring-security/properties/*", configuration);
for (final Element property : databaseProperties) {
getProjectOperations().addProperty(moduleName, new Property(property));
}
}
示例12: updatePomDependencies
import org.springframework.roo.project.Property; //导入依赖的package包/类
/**
* This method adds necessary dependencies to project pom.xml
*/
public void updatePomDependencies() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例13: addGvNIXAnnotationsDependecy
import org.springframework.roo.project.Property; //导入依赖的package包/类
public void addGvNIXAnnotationsDependecy() {
// Install the add-on Google code repository and dependency needed to
// get the annotations
Element conf = XmlUtils.getConfiguration(this.getClass());
// Install repositories
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", conf);
for (Element repo : repos) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", conf);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", conf);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
}
示例14: setup
import org.springframework.roo.project.Property; //导入依赖的package包/类
public void setup() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例15: setupMavenDependency
import org.springframework.roo.project.Property; //导入依赖的package包/类
public void setupMavenDependency() {
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on Google code repository and dependency needed to
// get the annotations
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
depens = XmlUtils.findElements(
"/configuration/dependencies/dependency", configuration);
for (Element depen : depens) {
projectOperations.addDependency(projectOperations
.getFocusedModuleName(), new Dependency(depen));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
}