oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1481650 - in /oltu/whiteboard/simonetripodi/oltu-commons: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/oltu/ src/main/java/org/apache/oltu/commons/ src/main/java/org/apache/oltu/com...
Date Sun, 12 May 2013 21:04:20 GMT
Author: simonetripodi
Date: Sun May 12 21:04:20 2013
New Revision: 1481650

URL: http://svn.apache.org/r1481650
Log:
[whiteboard] initial checkin of an alternative version of commons module, where entities model
are generated at 'generated-sources' time.
ATM each entity is generated with 'final' fields and a related Builder, next step is generating
a JSON/x-www-form-urlencoded (un)marshaller

Added:
    oltu/whiteboard/simonetripodi/oltu-commons/   (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/pom.xml   (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
  (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
  (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
  (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
  (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
  (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml   (with
props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml   (with
props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/resources/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl   (with props)
    oltu/whiteboard/simonetripodi/oltu-commons/src/test/
    oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/
    oltu/whiteboard/simonetripodi/oltu-commons/src/test/resources/

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun May 12 21:04:20 2013
@@ -0,0 +1,2 @@
+.settings
+target

Added: oltu/whiteboard/simonetripodi/oltu-commons/pom.xml
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/pom.xml?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/pom.xml (added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/pom.xml Sun May 12 21:04:20 2013
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.oltu</groupId>
+    <artifactId>org.apache.oltu.parent</artifactId>
+    <version>1</version>
+  </parent>
+
+  <artifactId>org.apache.oltu.commons</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <version>1.0</version>
+        <dependencies>
+          <dependency>
+            <groupId>xalan</groupId>
+            <artifactId>xalan</artifactId>
+            <version>2.7.1</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>transform</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <transformerFactory>org.apache.xalan.processor.TransformerFactoryImpl</transformerFactory>
+          <transformationSets>
+            <transformationSet>
+              <dir>${basedir}/src/main/mdo</dir>
+              <stylesheet>${basedir}/src/main/stylesheet/commons.xsl</stylesheet>
+              <outputDir>${project.build.directory}/generated-sources/model/org/apache/oltu/commons</outputDir>
+              <fileMappers>
+                <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+                  <targetExtension>.java</targetExtension>
+                </fileMapper>
+              </fileMappers>
+            </transformationSet>
+          </transformationSets>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.build.directory}/generated-sources/model</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
(added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
Sun May 12 21:04:20 2013
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oltu.commons;
+
+import static org.apache.oltu.commons.lang.Objects.checkNotNullArgument;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+public abstract class BaseMessage
+    implements Message
+{
+
+    private final Map<String, Object> parameters = new HashMap<String, Object>();
+
+    @Override
+    public final Object get( final String key )
+    {
+        String checkedKey = checkNotNullArgument( key, "key" );
+        return parameters.get( checkedKey );
+    }
+
+    @Override
+    public final <T> T get( final String key, final Class<T> type )
+    {
+        Object o = get( key );
+
+        Class<T> checkedType = checkNotNullArgument( type, "type" );
+
+        if ( o != null && checkedType.isAssignableFrom( o.getClass() ) ) {
+            return checkedType.cast( o );
+        }
+        return null;
+    }
+
+    @Override
+    public final <T> T set( final String key, final T value )
+    {
+        String checkedKey = checkNotNullArgument( key, "key" );
+        parameters.put( checkedKey, value );
+        return value;
+    }
+
+    @Override
+    public final Set<Entry<String, Object>> getAllParameters()
+    {
+        return parameters.entrySet();
+    }
+
+}

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/BaseMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
(added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
Sun May 12 21:04:20 2013
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oltu.commons;
+
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * Represents a generic message with custom fields.
+ */
+public interface Message
+{
+
+    Object get( String key );
+
+    <T> T get( String key, Class<T> type );
+
+    <T> T set( String key, T value );
+
+    Set<Entry<String, Object>> getAllParameters();
+
+}

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/Message.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
(added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
Sun May 12 21:04:20 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oltu.commons.lang;
+
+import static java.lang.String.format;
+
+public final class Objects
+{
+
+    private static final String NOT_NULL_PARAMETER_PATTERN = "Parameter '%s' can not be null.";
+
+    private Objects()
+    {
+        // do nothing
+    }
+
+    public static <T> T checkNotNullArgument( T object, String parameterName )
+    {
+        if ( object == null )
+        {
+            throw new IllegalArgumentException( format( NOT_NULL_PARAMETER_PATTERN, parameterName
) );
+        }
+        return object;
+    }
+
+}

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/Objects.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
(added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
Sun May 12 21:04:20 2013
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ *
+ */
+package org.apache.oltu.commons.lang;

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/lang/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
(added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
Sun May 12 21:04:20 2013
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ *
+ */
+package org.apache.oltu.commons;

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/java/org/apache/oltu/commons/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml (added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml Sun May
12 21:04:20 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<class name="AccessTokenRequest">
+  <description><![CDATA[Represents the Access Token Request as described in section
<a href="http://tools.ietf.org/html/rfc6749#section-4.3.2">4.3.2</a>.]]></description>
+  <parameter field="grantType" type="String" name="grant_type" required="true" />
+  <parameter field="username" type="String" name="username" required="true" />
+  <parameter field="password" type="long" name="password" required="false" />
+  <parameter field="scope" type="String" name="scope" required="false" />
+</class>

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenRequest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml (added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml Sun May
12 21:04:20 2013
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<class name="AccessTokenResponse">
+  <description><![CDATA[Represents the Access Token Response as described in section
<a href="http://tools.ietf.org/html/rfc6749#section-4.3.3">4.3.3</a>.]]></description>
+  <parameter field="accessToken" type="String" name="access_token" required="true" />
+  <parameter field="tokenType" type="String" name="token_type" required="true" />
+  <parameter field="expiresIn" type="long" name="expires_in" required="false" />
+  <parameter field="scope" type="String" name="scope" required="false" />
+  <parameter field="state" type="String" name="state" required="false" />
+</class>

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/mdo/AccessTokenResponse.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl?rev=1481650&view=auto
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl (added)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl Sun May 12
21:04:20 2013
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:output encoding="UTF-8" indent="yes" method="text" version="1.0" />
+
+  <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
+  <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="class" />
+  </xsl:template>
+
+  <xsl:template match="class">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oltu.commons;
+
+/**
+ * <xsl:value-of select="description" />
+ */
+public final class <xsl:value-of select="@name" />
+    extends BaseMessage
+{
+    <xsl:apply-templates select="parameter" mode="field" />
+    private <xsl:value-of select="@name" />(<xsl:apply-templates select="parameter"
mode="ctorArg" />)
+    {<xsl:apply-templates select="parameter" mode="ctorArgSetting" />
+    }
+
+    public static final class Builder
+    {
+
+        <xsl:apply-templates select="parameter" mode="builderField" />
+
+        /**
+         * Creates a new <xsl:value-of select="@name" /> instance.
+         *
+         * @return a new <xsl:value-of select="@name" /> instance.
+         */
+        public <xsl:value-of select="@name" /> build()
+        {
+            return new <xsl:value-of select="@name" />(<xsl:apply-templates select="parameter"
mode="builderArg" />);
+        }
+
+    }
+
+}
+</xsl:template>
+
+  <xsl:template match="parameter" mode="field">
+    /**
+     * The {@code <xsl:value-of select="@name" />} parameter.
+     */
+    private final <xsl:value-of select="@type" /><xsl:text> </xsl:text><xsl:value-of
select="@field" />;
+
+    /**
+     * Gets the {@code <xsl:value-of select="@name" />}.
+     *
+     * @return the {@code <xsl:value-of select="@name" />} parameter.
+     */
+    public <xsl:value-of select="@type" /> get<xsl:call-template name="toCamelCase"><xsl:with-param
name="fieldName" select="@field" /></xsl:call-template>()
+    {
+        return <xsl:value-of select="@field" />;
+    }
+  </xsl:template>
+
+  <xsl:template match="parameter" mode="ctorArg">
+    <xsl:if test="position() &gt; 1">, </xsl:if><xsl:value-of select="@type"
/><xsl:text> </xsl:text><xsl:value-of select="@field" />
+  </xsl:template>
+
+  <xsl:template match="parameter" mode="ctorArgSetting">
+        this.<xsl:value-of select="@field" /> = <xsl:value-of select="@field" />;</xsl:template>
+
+  <xsl:template match="parameter" mode="builderField">
+        /**
+         * The {@code <xsl:value-of select="@name" />} parameter.
+         */
+        private <xsl:value-of select="@type" /><xsl:text> </xsl:text><xsl:value-of
select="@field" />;
+
+        /**
+         * Sets the {@code <xsl:value-of select="@name" />}.
+         *
+         * @parameter <xsl:value-of select="@field" /> the {@code <xsl:value-of
select="@name" />} parameter.
+         * @return this builder instance.
+         */
+        public Builder set<xsl:call-template name="toCamelCase"><xsl:with-param
name="fieldName" select="@field" /></xsl:call-template>(<xsl:value-of select="@type"
/><xsl:text> </xsl:text><xsl:value-of select="@field" />)
+        {
+            this.<xsl:value-of select="@field" /> = <xsl:value-of select="@field"
/>;
+            return this;
+        }
+</xsl:template>
+
+  <xsl:template match="parameter" mode="builderArg">
+    <xsl:if test="position() &gt; 1">, </xsl:if><xsl:value-of select="@field"
/>
+  </xsl:template>
+
+  <xsl:template name="toCamelCase">
+    <xsl:param name="fieldName" />
+    <xsl:variable name="f" select="substring($fieldName, 1, 1)" />
+    <xsl:variable name="x" select="translate($f, $lcletters, $ucletters)" />
+    <xsl:variable name="s" select="substring($fieldName, 2)" />
+    <xsl:value-of select="$x" /><xsl:value-of select="$s" />
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message