Examples of ObjectDescription


Examples of com.art.anette.datamodel.dataobjects.meta.ObjectDescription

     */
    public final String toInsertQuery(List<Long> primaryKey, boolean isServer, long ts, Employee employee) {
        List<String> names = new ArrayList<String>();
        List<String> formattings = new ArrayList<String>();
        List<Object> values = new ArrayList<Object>();
        final ObjectDescription descr = getDescription();

        if (!descr.isRelation()) {
            if (!isServer || descr.isClientControlled()) {
                names.add("id");
                formattings.add("%d");
                values.add(primaryKey.get(0));
            }
            if (descr.isClientControlled()) {
                names.add("employee");
                formattings.add("%d");
                values.add(primaryKey.get(1));
            }
        }
        for (AttributeDescription attributeDescription : descr.getAttributes()) {
            if (attributeDescription.getType() == AttributeDescription.AttrType.AT_PASSWORD_STRING && !isServer) {
                // No password column on the client
                continue;
            }
            names.add(attributeDescription.getColumnName());
View Full Code Here

Examples of com.art.anette.datamodel.dataobjects.meta.ObjectDescription

     * @return der UPDATE-Query
     */
    public final String toUpdateQuery(boolean isServer, long ts, Employee employee) {
        List<String> parts = new ArrayList<String>();
        List<Object> values = new ArrayList<Object>();
        final ObjectDescription descr = getDescription();

        for (AttributeDescription attributeDescription : descr.getAttributes()) {
            if (attributeDescription.getType() == AttributeDescription.AttrType.AT_PASSWORD_STRING && !isServer) {
                // No password column on the client
                continue;
            }

View Full Code Here

Examples of net.sf.gluebooster.java.booster.essentials.meta.ObjectDescription

      }
    };
   
    // Invoke the command line
    CommandLineApplication.invoke(businessLogicWorker,
        new ObjectDescription(options), new String[] { "aaa",
            CommandLineApplication.OPTION_PREFIX + OPTION_2,
        OPTION_2_VALUE });

    // [/gb:useInDocumentation]
  }
View Full Code Here

Examples of net.sf.gluebooster.java.booster.essentials.meta.ObjectDescription

  @Test
  public void testXMLEncoder() throws Exception {
    String NAME = "my name";


    ObjectDescription objectDescription = new ObjectDescription();
    objectDescription.setName(NAME);

    ByteArrayOutputStream xml = new ByteArrayOutputStream();
    XmlBoostUtils.writeAsUtf8Xml(objectDescription, xml, true, 0);

    String xmlText = TextBoostUtils.toStringFromUtf8(xml.toByteArray());

    ObjectDescription description2 = XmlBoostUtils
        .readFromXml(new ByteArrayInputStream(
        xml.toByteArray()));
    Assert.assertEquals(objectDescription.getName(), description2.getName());

    ApplicationDescription app1 = new ApplicationDescription();
    app1.setName("Application 1");

    ApplicationDescription app2 = new ApplicationDescription();
View Full Code Here

Examples of net.sf.gluebooster.java.booster.essentials.meta.ObjectDescription

    for (int i = parameters.length - 1; i > -1; i--) {
      if (parameters[i] == null)
        parameters[i] = "";
    }

    ObjectDescription configuration = getConfiguration();
    ValueDescription valueDescription = configuration.getValueDescription();

    GnuParser parser = new GnuParser();
    try {
      valueDescription.setValue(parser.parse(getCommandLineOptions(),
        parameters));
    } catch (ParseException ex) {
      throw new ParseException(ex.getLocalizedMessage()
          + "\nOptions were " + Arrays.asList(parameters) + "\n"
          + getOptionsHelp());
    }

    if (!configuration.checkValue()) {
      throw new ParseException(configuration.toString());
    }

    return configuration;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ObjectDescription

                                     final DataSource datasource)
      throws BundleWriterException, IOException
  {
    final ClassFactoryCollector classFactoryCollector =
        writerContext.getClassFactoryCollector();
    ObjectDescription od =
        classFactoryCollector.getDescriptionForClass(datasource.getClass());
    if (od == null)
    {
      od = classFactoryCollector.
          getSuperClassObjectDescription(datasource.getClass(), null);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ObjectDescription

  {

    // Try to find the object description directly ...
    // by looking at the given object. This is the most accurate
    // option ...
    ObjectDescription parameterDescription;
    final Object o = objectDescription.getParameter(name);
    if (o != null)
    {
      parameterDescription = cc.getDescriptionForClass(o.getClass());
      if (parameterDescription == null)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ObjectDescription

      // Log.info ("Parameter '" + parameterName + "' is null. The Parameter will not be defined.");
      return;
    }

    final Class parameterDefinition = getObjectDescription().getParameterDefinition(parameterName);
    final ObjectDescription parameterDescription = getParameterDescription(parameterName);
    if (parameterDescription == null)
    {
      throw new ReportWriterException("Unable to get Parameter description for "
          + getObjectDescription().getObjectClass() + " Parameter: " + parameterName);
    }

    try
    {
      parameterDescription.setParameterFromObject(parameterValue);
    }
    catch (ObjectFactoryException ofe)
    {
      throw new ReportWriterException
          ("Unable to fill parameter object:" + parameterName, ofe);
    }

    final List parameterNames = ObjectWriter.getParameterNames(parameterDescription);
    if (parameterNames.isEmpty())
    {
      return;
    }

    final AttributeList p = new AttributeList();
    p.setAttribute(ExtParserModule.NAMESPACE, "name", parameterName);
    if (isUseParameterObjectDescription(parameterDefinition, parameterValue) == false)
    {
      p.setAttribute(ExtParserModule.NAMESPACE, "class", parameterValue.getClass().getName());
    }

    final XmlWriter writer = getXmlWriter();
    if (ObjectWriter.isBasicObject(parameterNames, parameterDescription))
    {
      writer.writeTag(ExtParserModule.NAMESPACE, AbstractXMLDefinitionWriter.BASIC_OBJECT_TAG, p,
          XmlWriterSupport.OPEN);
      final String valueString = (String) parameterDescription.getParameter("value");
      writer.writeTextNormalized(valueString, false);
      writer.writeCloseTag();
    }
    else
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ObjectDescription

   * @return true, if the default parameter description would be used, false otherwise.
   */
  private boolean isUseParameterObjectDescription(final Class parameter, final Object o)
  {
    final ClassFactoryCollector cc = getReportWriter().getClassFactoryCollector();
    ObjectDescription odObject = cc.getDescriptionForClass(o.getClass());
    ObjectDescription odParameter = cc.getDescriptionForClass(parameter);

    // search the most suitable super class object description ...
    if (odObject == null)
    {
      odObject = cc.getSuperClassObjectDescription(o.getClass(), odObject);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ObjectDescription

  }

  public void testObjectQuery()
  {
    final DefaultClassFactory fact = new DefaultClassFactory();
    final ObjectDescription line2DDescr = fact.getDescriptionForClass(Line2D.class);
    assertNotNull(line2DDescr);
    final ObjectDescription od = fact.getSuperClassObjectDescription(Line2D.Float.class, null);
    assertEquals(line2DDescr.getClass(), od.getClass());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.