Tabnine Logo
Property
Code IndexAdd Tabnine to your IDE (free)

How to use
Property
in
org.fabric3.api.model.type.component

Best Java code snippets using org.fabric3.api.model.type.component.Property (Showing top 15 results out of 315)

origin: com.carecon.fabric3/fabric3-introspection-java

private Property createDefinition(String name, boolean required, Type type, TypeMapping typeMapping) {
  Property property = new Property(name);
  property.setRequired(required);
  MultiplicityType multiplicityType = helper.introspectMultiplicity(type, typeMapping);
  property.setMany(MultiplicityType.COLLECTION == multiplicityType || MultiplicityType.DICTIONARY == multiplicityType);
  return property;
}
origin: org.fabric3/fabric3-model-api

/**
 * Add a property defined by the implementation.
 *
 * @param property the property to add
 */
public void add(Property property) {
  property.setParent(this);
  properties.put(property.getName(), property);
}
origin: com.carecon.fabric3/fabric3-system

private void addProperty(InjectingComponentType componentType, TypeMapping typeMapping, String name, Type type, InjectionSite site) {
  Property property = new Property(name);
  MultiplicityType multiplicityType = helper.introspectMultiplicity(type, typeMapping);
  property.setMany(MultiplicityType.COLLECTION == multiplicityType || MultiplicityType.DICTIONARY == multiplicityType);
  componentType.add(property, site);
}
origin: com.carecon.fabric3/fabric3-fabric

String name = property.getName();
boolean required = property.isRequired();
PropertyValue propertyValue = propertyValues.get(name);
if (propertyValue != null && propertyValue.getInstanceValue() != null) {
  String propertyKey = null;
  if (propertyValue == null) {
    String source = property.getSource();
    if (source != null) {
      if (source.startsWith("${") && source.endsWith("}")) {
          for (Map.Entry<String, String> entry : property.getNamespaces().entrySet()) {
            nsContext.add(entry.getKey(), entry.getValue());
      value = property.getDefaultValue();
      value = loadValueFromFile(property.getName(), propertyValue.getFile(), logicalComponent, context);
    } else if (propertyValue.getSource() != null) {
    boolean many = property.isMany();
    LogicalProperty.Builder builder = LogicalProperty.Builder.newBuilder(name, logicalComponent);
    LogicalProperty logicalProperty = builder.key(propertyKey).many(many).required(required).build();
    logicalComponent.setProperties(logicalProperty);
  } else if (property.isRequired() && value == null && (propertyValue == null || (propertyValue != null
                                          && propertyValue.getInstanceValue() == null))) {
  } else if (!property.isRequired() && value == null) {
    boolean many = property.isMany();
origin: com.carecon.fabric3/fabric3-fabric

private void includeProperty(Property property, LogicalCompositeComponent domain, InstantiationContext context) {
  String name = property.getName();
  if (domain.getAllProperties().containsKey(name)) {
    DuplicateProperty error = new DuplicateProperty(name, domain);
    context.addError(error);
  } else {
    Document value = property.getDefaultValue();
    boolean many = property.isMany();
    QName type = property.getType();
    LogicalProperty logicalProperty = LogicalProperty.Builder.newBuilder(name, domain).xmlValue(value).many(many).type(type).build();
    domain.setProperties(logicalProperty);
  }
}
origin: com.carecon.fabric3/fabric3-spring

Property property = new Property(name);
property.setRequired(true);
  property.setType(XSD_INT);
} else if (Boolean.class.getName().equals(propertyType)) {
  property.setType(XSD_BOOLEAN);
} else {
  property.setType(XSD_STRING);
origin: org.fabric3/fabric3-model-api

/**
 * Adds a property to the composite parsed from the XML source.
 *
 * @param name   the property name
 * @param source the XML source
 * @return the builder
 * @throws ModelBuilderException if an error reading the source occurs
 */
public CompositeBuilder property(String name, URL source) {
  checkState();
  try {
    Document document = DOCUMENT_FACTORY.newDocumentBuilder().parse(source.openStream());
    // all properties have a root <values> element, append the existing root to it. The existing root will be taken as a property <value>.
    Element oldRoot = document.getDocumentElement();
    Element newRoot = document.createElement("values");
    document.removeChild(oldRoot);
    document.appendChild(newRoot);
    newRoot.appendChild(oldRoot);
    Property property = new Property(name);
    property.setDefaultValue(document);
    composite.add(property);
  } catch (IOException | ParserConfigurationException | SAXException e) {
    throw new ModelBuilderException(e);
  }
  return this;
}
origin: com.carecon.fabric3/fabric3-web

private void generatePropertyInjectionMapping(Property property, Map<String, Map<String, InjectionSite>> mappings) {
  Map<String, InjectionSite> mapping = mappings.get(property.getName());
  if (mapping == null) {
    mapping = new HashMap<>();
    mappings.put(property.getName(), mapping);
  }
  // inject the property into the session context
  // we don't need to do the type mappings from schema to Java so set Object as the type
  WebContextInjectionSite site = new WebContextInjectionSite(Object.class, SERVLET_CONTEXT);
  mapping.put(SESSION_CONTEXT_SITE, site);
}
origin: com.carecon.fabric3/fabric3-spring

private void processPropertyValues(LogicalComponent<?> component, PhysicalSpringComponent springComponent) {
  for (LogicalProperty property : component.getAllProperties().values()) {
    String name = property.getName();
    boolean many = property.isMany();
    if (property.getXmlValue() != null) {
      Document document = property.getXmlValue();
      ComponentType componentType = component.getDefinition().getImplementation().getComponentType();
      QName type = componentType.getProperties().get(property.getName()).getType();
      PhysicalProperty physicalProperty =  PhysicalProperty.Builder.newBuilder(name).xmlValue(document).many(many).type(type).build();
      springComponent.setProperty(physicalProperty);
    } else if (property.getInstanceValue() != null) {
      Object value = property.getInstanceValue();
      PhysicalProperty physicalProperty =  PhysicalProperty.Builder.newBuilder(name).instanceValue(value).many(many).build();
      springComponent.setProperty(physicalProperty);
    }
  }
}
origin: org.fabric3/fabric3-fabric

String name = property.getName();
boolean required = property.isRequired();
PropertyValue propertyValue = propertyValues.get(name);
if (propertyValue != null && propertyValue.getInstanceValue() != null) {
  String propertyKey = null;
  if (propertyValue == null) {
    String source = property.getSource();
    if (source != null) {
      if (source.startsWith("${") && source.endsWith("}")) {
          for (Map.Entry<String, String> entry : property.getNamespaces().entrySet()) {
            nsContext.add(entry.getKey(), entry.getValue());
      value = property.getDefaultValue();
      value = loadValueFromFile(property.getName(), propertyValue.getFile(), logicalComponent, context);
    } else if (propertyValue.getSource() != null) {
    boolean many = property.isMany();
    LogicalProperty.Builder builder = LogicalProperty.Builder.newBuilder(name, logicalComponent);
    LogicalProperty logicalProperty = builder.key(propertyKey).many(many).required(required).build();
    logicalComponent.setProperties(logicalProperty);
  } else if (property.isRequired() && value == null && (propertyValue == null || (propertyValue != null
                                          && propertyValue.getInstanceValue() == null))) {
  } else if (!property.isRequired() && value == null) {
    boolean many = property.isMany();
origin: org.fabric3/fabric3-fabric

private void includeProperty(Property property, LogicalCompositeComponent domain, InstantiationContext context) {
  String name = property.getName();
  if (domain.getAllProperties().containsKey(name)) {
    DuplicateProperty error = new DuplicateProperty(name, domain);
    context.addError(error);
  } else {
    Document value = property.getDefaultValue();
    boolean many = property.isMany();
    QName type = property.getType();
    LogicalProperty logicalProperty = LogicalProperty.Builder.newBuilder(name, domain).xmlValue(value).many(many).type(type).build();
    domain.setProperties(logicalProperty);
  }
}
origin: org.fabric3/fabric3-spring

Property property = new Property(name);
property.setRequired(true);
  property.setType(XSD_INT);
} else if (Boolean.class.getName().equals(propertyType)) {
  property.setType(XSD_BOOLEAN);
} else {
  property.setType(XSD_STRING);
origin: com.carecon.fabric3/fabric3-java

private void addProperty(InjectingComponentType componentType,
             String name,
             Type type,
             Class<?> declaringClass,
             InjectionSite site,
             IntrospectionContext context) {
  TypeMapping typeMapping = context.getTypeMapping(declaringClass);
  Property property = new Property(name);
  MultiplicityType multiplicityType = helper.introspectMultiplicity(type, typeMapping);
  property.setMany(MultiplicityType.COLLECTION == multiplicityType || MultiplicityType.DICTIONARY == multiplicityType);
  componentType.add(property, site);
}
origin: org.fabric3/fabric3-model-api

/**
 * Add a property and its associated with an injection site.
 *
 * @param property      the property to add
 * @param injectionSite the injection site for the property
 */
public void add(Property property, InjectionSite injectionSite) {
  super.add(property);
  Injectable injectable = new Injectable(InjectableType.PROPERTY, property.getName());
  addInjectionSite(injectionSite, injectable);
  injectionSiteMapping.put(property, injectionSite);
}
origin: org.fabric3/fabric3-spring

private void processPropertyValues(LogicalComponent<?> component, PhysicalSpringComponent springComponent) {
  for (LogicalProperty property : component.getAllProperties().values()) {
    String name = property.getName();
    boolean many = property.isMany();
    if (property.getXmlValue() != null) {
      Document document = property.getXmlValue();
      ComponentType componentType = component.getDefinition().getImplementation().getComponentType();
      QName type = componentType.getProperties().get(property.getName()).getType();
      PhysicalProperty physicalProperty =  PhysicalProperty.Builder.newBuilder(name).xmlValue(document).many(many).type(type).build();
      springComponent.setProperty(physicalProperty);
    } else if (property.getInstanceValue() != null) {
      Object value = property.getInstanceValue();
      PhysicalProperty physicalProperty =  PhysicalProperty.Builder.newBuilder(name).instanceValue(value).many(many).build();
      springComponent.setProperty(physicalProperty);
    }
  }
}
org.fabric3.api.model.type.componentProperty

Javadoc

A component type property.

Most used methods

  • <init>
  • getName
    Returns the name of the property.
  • getType
    Returns the property XSD type or null if it is not an XSD type.
  • setMany
    Sets whether the property is many-valued or single-valued.
  • setRequired
    Sets whether the component definition must supply a value for this property.
  • getDefaultValue
    Returns the default property value as a DOM.
  • getNamespaces
  • getSource
    Returns the property source
  • isMany
    Returns whether the property is many-valued or single-valued.
  • isRequired
    Returns whether the component definition must supply a value for this property.
  • setType
    Sets the XSD type
  • addNamespace
    Adds a namespace used to resolve a property source.
  • setType,
  • addNamespace,
  • setDefaultValue,
  • setParent,
  • setSource

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JComboBox (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now